From e5d0ca8c194b54e149ab83368846f7f67cb54e89 Mon Sep 17 00:00:00 2001 From: PeiYong Zhang <peiyongz@apache.org> Date: Tue, 20 May 2003 16:21:02 +0000 Subject: [PATCH] Pluggable Panic Handler git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175004 13f79535-47bb-0310-9956-ffa450edef68 --- doc/program-others.xml | 41 +++++++++++++++++++++++++++++++++++++++-- doc/program.xml | 4 +++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/doc/program-others.xml b/doc/program-others.xml index da1e2b64f..017ffa59a 100644 --- a/doc/program-others.xml +++ b/doc/program-others.xml @@ -511,7 +511,7 @@ new XERCES_CPP_NAMESPACE_QUALIFIER SAXParser(); <anchor name="SpecifyLocaleForMessageLoader"/> - <s2 title="Specify locale for message loader"> + <s2 title="Specify Locale for Message Loader"> <p>The &XercesCName; has implemented mechanism to support NLS, though the current drop has only English version message file, it is capable @@ -541,7 +541,7 @@ new XERCES_CPP_NAMESPACE_QUALIFIER SAXParser(); <anchor name="SpecifyLocationForMessageLoader"/> - <s2 title="Specify location for message loader"> + <s2 title="Specify Location for Message Loader"> <p>The &XercesCName; searches for message files at the default message directory, $XERCESCROOT/msg. </p> @@ -565,6 +565,43 @@ new XERCES_CPP_NAMESPACE_QUALIFIER SAXParser(); { } .. +</source> + + <anchor name="PluggablePanicHandler"/> + <s2 title="Pluggable Panic Handler"> + + <p>The &XercesCName; reports, through the method panic(), any panic encountered, + to the panic handler installed, which in turn takes whatever action appropriate, + to handle the panic. + </p> + <p>The &XercesCName; allows application plugging a customized panic handler + (class implementing the interface PanicHandler), in its very first invocation to + XMLPlatformUtils::Initialize() by supplying a parameter for the panic handler + intended. + </p> + <p>In the absence of such a plugged panic handler, &XercesCName; default + panic handler is installed and used, which aborts program whenever a panic + is seen. + </p> + </s2> + +<source> + +... + // Initialize the parser system + try + { + PanicHandler* ph = new MyPanicHandler(); + + XMLPlatformUtils::Initialize("en_US" + , "/usr/application_root/msg_home" + , ph); + } + + catch () + { + } +.. </source> <anchor name="UseSpecificScanner"/> diff --git a/doc/program.xml b/doc/program.xml index 386c93391..f34a523c0 100644 --- a/doc/program.xml +++ b/doc/program.xml @@ -81,8 +81,10 @@ <li><jump href="program-others.html#PluggableTranscoders">Pluggable Transcoders</jump></li> <li><jump href="program-others.html#PortingGuidelines">Porting Guidelines</jump></li> <li><jump href="program-others.html#CPPNamespace">Using C++ Namespace</jump></li> - <li><jump href="program-others.html#SpecifylocaleforMessageLoader">Specify locale for Message Loader</jump></li> + <li><jump href="program-others.html#SpecifylocaleforMessageLoader">Specify Locale for Message Loader</jump></li> + <li><jump href="program-others.html#SpecifylocationforMessageLoader">Specify Location for Message Loader</jump></li> <li><jump href="program-others.html#UseSpecificScanner">Use Specific Scanner</jump></li> + <li><jump href="program-others.html#PluggablePanicHandler">Pluggable Panic Handler</jump></li> </ul> </s2> -- GitLab