com.netscape.pm.model
Class PMException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--com.netscape.pm.model.PMException
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- XDeploymentManager
- public class PMException
- extends java.lang.Exception
- implements java.io.Serializable
Exception class for exceptions thrown in BPM world. The class is designed
to contain multiple "events" which provide more in-depth information about
a particular exception. As an exception is bubbled up to the top of the
call-chain, each intervening level can chain itself to the lower-level
exceptions.
The information for each exception is partially provided via constructors
at time of instantiation and partially from the resource files. Each
resource entry will follow the format:
exception.symbol.severity = [1 (lowest) <= severity <= 10 (highest)]
- default is 5
exception.symbol.type = [information|error|system|warning|security]
- default is error
exception.symbol.prettyname = title for exception (required)
exception.symbol.description = description for exception, MessageFormat
enabled string.
exception.symbol.fix = description of probable fix for exception,
MessageFormat enabled string.
Each exception can also specify a context, which consists of name-value pairs
of variables that may help deduce what happened at the time. The context is
an Object[], entries i specify the name, entries i+1 specify the value.
We also have the option of passing in a previous PMException to the
constructor, which will be chained to the current exception. The exceptions
are chained in a top->bottom manner; that is, the oldest exception (deepest
and probably most-specific) is furthest down the chain, the newest is the
current exception. Instead of traversing the chain, we can use the last()
method to jump to the bottom of the chain quickly.
Each exception can have n events attached to it (optional). Each event is
intended to provide additional information still relevant to the larger
encompassing exception. Similar to the exceptions, a portion of the
information for the event is provided from the resource files. Each event
entry will follow the format:
event.symbol.prettyname = title for event (required)
event.symbol.description = description for event, MessageFormat enabled
string.
event.symbol.fix = description of probable fix for event, MessageFormat
enabled string.
Each event can also pass in a context similar to the one described for
exceptions.
- See Also:
- Serialized Form
Constructor Summary |
PMException()
|
PMException(java.lang.Exception e)
|
PMException(PMException pme)
|
PMException(java.lang.String symbol)
|
PMException(java.lang.String msg,
int type)
|
PMException(java.lang.String msg,
int type,
java.util.Hashtable params)
|
PMException(java.lang.String symbol,
java.lang.Object[] mesgArgs)
|
PMException(java.lang.String symbol,
java.lang.Object[] mesgArgs,
java.lang.Object[] context)
|
PMException(java.lang.String symbol,
java.lang.Object[] mesgArgs,
java.lang.Object[] context,
PMException pme)
|
PMException(java.lang.String symbol,
java.lang.Object[] mesgArgs,
PMException pme)
|
PMException(java.lang.String symbol,
PMException pme)
|
PMException(java.lang.String msg,
java.lang.String reason)
|
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
EXCEPTION_TYPE_INFORMATION
public static final int EXCEPTION_TYPE_INFORMATION
EXCEPTION_TYPE_ERROR
public static final int EXCEPTION_TYPE_ERROR
EXCEPTION_TYPE_SYSTEM
public static final int EXCEPTION_TYPE_SYSTEM
EXCEPTION_TYPE_WARNING
public static final int EXCEPTION_TYPE_WARNING
EXCEPTION_TYPE_SECURITY
public static final int EXCEPTION_TYPE_SECURITY
DEFAULT_SEVERITY
public static final int DEFAULT_SEVERITY
DEFAULT_EXCEPTION_TYPE
public static final int DEFAULT_EXCEPTION_TYPE
mSymbol
protected java.lang.String mSymbol
mNumber
protected int mNumber
mExceptionType
protected int mExceptionType
mSeverity
protected int mSeverity
mPrettyName
protected java.lang.String mPrettyName
mDescription
protected java.lang.String mDescription
mFix
protected java.lang.String mFix
mContext
protected java.util.Hashtable mContext
mNext
protected PMException mNext
mPrevious
protected PMException mPrevious
mLast
protected PMException mLast
mEvents
protected java.util.Vector mEvents
mMesgArgs
protected java.lang.Object[] mMesgArgs
mCustomErrorMessage
protected java.lang.String mCustomErrorMessage
PMException
public PMException(java.lang.String symbol)
PMException
public PMException(PMException pme)
PMException
public PMException(java.lang.String symbol,
PMException pme)
PMException
public PMException(java.lang.String symbol,
java.lang.Object[] mesgArgs)
PMException
public PMException(java.lang.String symbol,
java.lang.Object[] mesgArgs,
PMException pme)
PMException
public PMException(java.lang.String symbol,
java.lang.Object[] mesgArgs,
java.lang.Object[] context)
PMException
public PMException(java.lang.String symbol,
java.lang.Object[] mesgArgs,
java.lang.Object[] context,
PMException pme)
PMException
public PMException()
PMException
public PMException(java.lang.Exception e)
PMException
public PMException(java.lang.String msg,
java.lang.String reason)
PMException
public PMException(java.lang.String msg,
int type)
PMException
public PMException(java.lang.String msg,
int type,
java.util.Hashtable params)
addEvent
public void addEvent(java.lang.String symbol)
addEvent
public void addEvent(java.lang.String symbol,
java.lang.Object[] mesgArgs)
addEvent
public void addEvent(java.lang.String symbol,
java.lang.Object[] mesgArgs,
java.lang.Object[] context)
getSymbol
public java.lang.String getSymbol()
getNumber
public int getNumber()
getExceptionType
public int getExceptionType()
setExceptionType
public void setExceptionType(int type)
getSeverity
public int getSeverity()
getPrettyName
public java.lang.String getPrettyName()
getDescription
public java.lang.String getDescription()
getFix
public java.lang.String getFix()
getContext
public java.util.Hashtable getContext()
getMessageArgs
public java.lang.Object[] getMessageArgs()
getCustomErrorMessage
public java.lang.String getCustomErrorMessage()
getEvents
public java.util.Vector getEvents()
getEventCount
public int getEventCount()
getEventSymbol
public java.lang.String getEventSymbol(int i)
getEventPrettyName
public java.lang.String getEventPrettyName(int i)
getEventDescription
public java.lang.String getEventDescription(int i)
getEventFix
public java.lang.String getEventFix(int i)
getEventContext
public java.util.Hashtable getEventContext(int i)
setMessageArgs
public void setMessageArgs(java.lang.Object[] mesgArgs)
setContext
public void setContext(java.lang.Object[] context)
setContext
public void setContext(java.util.Hashtable context)
setCustomErrorMessage
public void setCustomErrorMessage(java.lang.String cError)
toXML
public java.lang.String toXML()
- Serialize exception contents to XML. Currently, only the top-level
(this) exception is output, without regard to any exceptions that may
be chained to it. This method is primarily to be used to transport
a PMException through another Exception layer, and enable us to rebuild
the PMException using fromXML().
The current DTD is:
mSymbol
mExceptionType
mSeverity
mPrettyName
mDescription
mFix
mCustomMessage
key
value
...
event.getSymbol()
event.getPrettyName()
event.getDescription()
event.getFix()
...
toHTML
public java.lang.String toHTML()
toHistory
public java.lang.String toHistory()
- Serialize exception contents for storage in history comments field.
Format is:
format : 'X' symbol custMsg mesgArgs
symbol : len{ mSymbol }
custMsg : len{ mCustomErrorMessage }
mesgArgs : mesgArgs mesgArg
|
mesgArg : len{ mesgArg }
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Throwable
fromXML
public static PMException fromXML(java.lang.String xml)
throws PMException
fromHistory
public static PMException fromHistory(java.lang.String s)
throws java.lang.Exception
convert2ExceptionType
public static int convert2ExceptionType(java.lang.String type)
convertFromExceptionType
public static java.lang.String convertFromExceptionType(int type)
setPropertyBundleName
public static void setPropertyBundleName(java.lang.String name)