|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception org.xmlBlaster.util.XmlBlasterException
public class XmlBlasterException
The basic exception handling class for xmlBlaster.
This exception will be thrown in remote RMI calls as well.
The getMessage() method returns a configurable formatted string here is an example how to configure the format in your xmlBlaster.properties:
XmlBlasterException.logFormat=XmlBlasterException errorCode=[{0}] node=[{1}] location=[{2}] message=[{4} : {8}] XmlBlasterException.logFormat.internal= XmlBlasterException errorCode=[{0}] node=[{1}] location=[{2}]\nmessage={4} : {8}\nversionInfo={5}\nstackTrace={7} XmlBlasterException.logFormat.resource= defaults to XmlBlasterException.logFormat XmlBlasterException.logFormat.communication= defaults to XmlBlasterException.logFormat XmlBlasterException.logFormat.user= defaults to XmlBlasterException.logFormat XmlBlasterException.logFormat.transaction= defaults to XmlBlasterException.logFormat XmlBlasterException.logFormat.legacy= defaults to XmlBlasterException.logFormatwhere the replacements are:
{0} = errorCodeStr {1} = node {2} = location {3} = isServerSide // exception thrown from server or from client? {4} = message {5} = versionInfo {6} = timestamp {7} = stackTrace {8} = embeddedMessage {9} = errorCode.getDescription() // {10} = transactionInfo IBM's JDK MakeFormat only supports 9 digits // {11} = lang IBM's JDK MakeFormat only supports 9 digits
You can register your own exception handler which intercepts all XmlBlasterException creations and for example do a shutdown on certain ErrorCodes
java -Dorg.xmlBlaster.util.I_XmlBlasterExceptionHandler=MyHandler org.xmlBlaster.Mainthis must be a class implementing I_XmlBlasterExceptionHandler, as a default Main.java registers itself and does an immediate shutdown on RESOURCE_DB_UNAVAILABLE
org.xmlBlaster.test.classtest.XmlBlasterExceptionTest
,
Serialized FormConstructor Summary | |
---|---|
XmlBlasterException(Global glob,
ErrorCode errorCodeEnum,
java.lang.String location)
The errorCodeEnum.getDescription() is used as error message. |
|
XmlBlasterException(Global glob,
ErrorCode errorCodeEnum,
java.lang.String location,
java.lang.String message)
|
|
XmlBlasterException(Global glob,
ErrorCode errorCodeEnum,
java.lang.String node,
java.lang.String location,
java.lang.String lang,
java.lang.String message,
java.lang.String versionInfo,
Timestamp timestamp,
java.lang.String stackTrace,
java.lang.String embeddedMessage,
java.lang.String transcationInfo,
boolean isServerSide)
For internal use: Deserializing and exception creation from CORBA XmlBlasterException |
|
XmlBlasterException(Global glob,
ErrorCode errorCodeEnum,
java.lang.String location,
java.lang.String message,
java.lang.Throwable cause)
|
|
XmlBlasterException(java.lang.String location,
java.lang.String message)
Deprecated. Please use constructor which uses ErrorCode |
Method Summary | |
---|---|
void |
changeErrorCode(ErrorCode errorCodeEnum)
|
static XmlBlasterException |
convert(Global glob,
ErrorCode errorCodeEnum,
java.lang.String location,
java.lang.String message,
java.lang.Throwable throwable)
|
static XmlBlasterException |
convert(Global glob,
java.lang.String location,
java.lang.String message,
java.lang.Throwable throwable)
If throwable is of type XmlBlasterException it is just casted (and location/message are ignored) else if throwable is one if IllegalArgumentException, NullpointerException or OutOfMemoryError it is converted to an XmlBlasterException with corresponding ErrorCode otherwise the ErrorCode is INTERNAL_UNKNOWN |
java.lang.String |
createStackTrace()
|
static java.lang.String |
createStackTrace(java.lang.Throwable e)
|
static java.lang.String |
createVersionInfo()
|
java.lang.Throwable |
getEmbeddedException()
The original exception, note that this is not serialized. |
java.lang.String |
getEmbeddedMessage()
|
ErrorCode |
getErrorCode()
|
java.lang.String |
getErrorCodeStr()
|
static I_XmlBlasterExceptionHandler |
getExceptionHandler()
|
Global |
getGlobal()
|
java.lang.String |
getLang()
|
java.lang.String |
getLocation()
|
java.lang.String |
getMessage()
Configurable with property XmlBlasterException.logFormat, XmlBlasterException.logFormat.internal XmlBlasterException.logFormat.resource etc. |
java.lang.String |
getNode()
|
ErrorCode |
getOriginalErrorCode()
|
java.lang.String |
getRawMessage()
Get the original message text, it is prefixed by the current subversion revision number. |
java.lang.String |
getStackTraceStr()
|
Timestamp |
getTimestamp()
Timestamp when exception was thrown |
java.lang.String |
getTransactionInfo()
|
java.lang.String |
getVersionInfo()
A comma separated list with key/values containing detailed information about the server environment |
boolean |
isCleanupSession()
|
boolean |
isCommunication()
|
boolean |
isErrorCode(ErrorCode code)
|
boolean |
isInternal()
|
boolean |
isResource()
|
boolean |
isServerSide()
|
void |
isServerSide(boolean serverSide)
|
boolean |
isTransaction()
|
boolean |
isUser()
|
static void |
main(java.lang.String[] args)
java org.xmlBlaster.util.XmlBlasterException |
static XmlBlasterException |
parseByteArr(Global glob,
byte[] data)
|
static XmlBlasterException |
parseByteArr(Global glob,
byte[] data,
ErrorCode fallback)
Serialize the complete exception. |
static XmlBlasterException |
parseToString(Global glob,
java.lang.String toString,
ErrorCode fallback)
Parsing what toString() produced |
void |
setCleanupSession(boolean cleanupSession)
|
static void |
setExceptionHandler(I_XmlBlasterExceptionHandler exceptionHandler)
|
void |
setLocation(java.lang.String location)
Overwrite the location |
void |
setLogFormatInternal(java.lang.String logFormatInternal)
Overwrite the formatting of internal logs (the env property -XmlBlasterException.logFormat.internal) |
byte[] |
toByteArr()
Serialize the complete exception |
java.lang.String |
toString()
Caution: The syntax is used by parseToString() to parse the stringified exception again. This is used by XmlRpc, see XmlRpcConnection.extractXmlBlasterException() |
java.lang.String |
toXml()
|
java.lang.String |
toXml(java.lang.String extraOffset)
Create a XML representation of the Exception. |
static XmlBlasterException |
tranformCallbackException(XmlBlasterException e)
|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XmlBlasterException(Global glob, ErrorCode errorCodeEnum, java.lang.String location)
public XmlBlasterException(Global glob, ErrorCode errorCodeEnum, java.lang.String location, java.lang.String message)
public XmlBlasterException(Global glob, ErrorCode errorCodeEnum, java.lang.String location, java.lang.String message, java.lang.Throwable cause)
public XmlBlasterException(Global glob, ErrorCode errorCodeEnum, java.lang.String node, java.lang.String location, java.lang.String lang, java.lang.String message, java.lang.String versionInfo, Timestamp timestamp, java.lang.String stackTrace, java.lang.String embeddedMessage, java.lang.String transcationInfo, boolean isServerSide)
public XmlBlasterException(java.lang.String location, java.lang.String message)
Method Detail |
---|
public final ErrorCode getOriginalErrorCode()
public final void changeErrorCode(ErrorCode errorCodeEnum)
public final Global getGlobal()
public final ErrorCode getErrorCode()
public final boolean isErrorCode(ErrorCode code)
public final java.lang.String getErrorCodeStr()
public final java.lang.String getNode()
public final java.lang.String getLocation()
public final void setLocation(java.lang.String location)
public final java.lang.String getLang()
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public final java.lang.String getRawMessage()
public final java.lang.String getVersionInfo()
public final Timestamp getTimestamp()
public final java.lang.Throwable getEmbeddedException()
public final java.lang.String getStackTraceStr()
stackTrace= errorCode=internal.unknown message=Bla bla at org.xmlBlaster.util.XmlBlasterException.main(XmlBlasterException.java:488)The first line is the result from toString() and the following lines are the stackTrace
public final java.lang.String getEmbeddedMessage()
public final java.lang.String getTransactionInfo()
public final boolean isServerSide()
public final void isServerSide(boolean serverSide)
serverSide
- true to mark the exception has occurred on server side, false if happened on client sidepublic boolean isInternal()
public boolean isResource()
public boolean isCommunication()
public boolean isUser()
public boolean isTransaction()
public java.lang.String createStackTrace()
public static java.lang.String createStackTrace(java.lang.Throwable e)
public static java.lang.String createVersionInfo()
public java.lang.String toString()
toString
in class java.lang.Throwable
public static XmlBlasterException parseToString(Global glob, java.lang.String toString, ErrorCode fallback)
glob
- toString
- The original exceptionfallback
- The error code to use if 'toString' is unparsablepublic final java.lang.String toXml()
toXml(String)
public java.lang.String toXml(java.lang.String extraOffset)
<exception errorCode='resource.outOfMemory'> <class>JavaClass</class> <message><![cdata[ bla bla ]]></message> </exception>
public byte[] toByteArr()
public static XmlBlasterException parseByteArr(Global glob, byte[] data)
public static XmlBlasterException parseByteArr(Global glob, byte[] data, ErrorCode fallback)
public static XmlBlasterException convert(Global glob, java.lang.String location, java.lang.String message, java.lang.Throwable throwable)
location
- null if not of interestmessage
- null if not of interestthrowable
- Any exception type you can think of
public static XmlBlasterException convert(Global glob, ErrorCode errorCodeEnum, java.lang.String location, java.lang.String message, java.lang.Throwable throwable)
errorCodeEnum
- is the fallback error codepublic void setLogFormatInternal(java.lang.String logFormatInternal)
public static XmlBlasterException tranformCallbackException(XmlBlasterException e)
public static void main(java.lang.String[] args)
public static I_XmlBlasterExceptionHandler getExceptionHandler()
public static void setExceptionHandler(I_XmlBlasterExceptionHandler exceptionHandler)
exceptionHandler
- The exceptionHandler to set.public boolean isCleanupSession()
public void setCleanupSession(boolean cleanupSession)
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |