|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DistributedExceptionEnabled
Enables an exception to be treated as a distributed exception.. This interface should be used by an exception that is not a subclass of DistributedException.
In addition to implementing the required methods, the implementing class should create an attribute, a DistributedExceptionInfo object, in each constructor, after it has done it's other work. This object will do most of the work for the methods. For all of the examples in the Javadoc of the methods, it is assumed that the name of this attribute is distributedExceptionInfo.
Typically, the implementor of this interface will have multiple constructors. See com.ibm.websphere.DistributedException for examples.
com.ibm.websphere.DistributedException
,
com.ibm.websphere.DistributedExceptionInfo
Method Summary | |
---|---|
java.lang.Throwable |
getException(java.lang.String exceptionClassName)
Get a specific exception in a possible chain of exceptions. |
DistributedExceptionInfo |
getExceptionInfo()
Retrieve the exception info for this exception. |
java.lang.String |
getMessage()
Retrieve the message for this exception. |
java.lang.Throwable |
getOriginalException()
Get the original exception in a possible chain of exceptions. |
java.lang.Throwable |
getPreviousException()
Get the previous exception, in a possible chain of exceptions. |
void |
printStackTrace()
Print the stack trace for this exception and all chained exceptions. |
void |
printStackTrace(java.io.PrintWriter pw)
Print the exception execution stack to a print writer. |
void |
printSuperStackTrace(java.io.PrintWriter pw)
This method is called by DistributedExceptionInfo to retrieve and save the current stack trace. |
Method Detail |
---|
java.lang.Throwable getException(java.lang.String exceptionClassName) throws ExceptionInstantiationException
If the DistributedExceptionInfo attribute is not null, the return value can be retrieved with the following code:
String
- exceptionClassName: The class name of the specific exception.
ExceptionInstantiationException
- An exception occurred while trying to re-create the exception object.
If this exception is thrown, the relevant information can be retrieved
by using the getExceptionInfo() method followed by recursively using
the getPreviousExceptionInfo() method on the DistributedExceptionInfo
object.DistributedExceptionInfo getExceptionInfo()
This could be coded as:
java.lang.String getMessage()
The following is an example of the code that should be used:
Note: During the construction of the exception and the DistributedExceptionInfo object, there is one situation that results in a call to this method. Since distributedExceptionInfo is still null, a NullPointerException could occur if the check for null is excluded.
java.lang.Throwable getOriginalException() throws ExceptionInstantiationException
If the DistributedExceptionInfo attribute is not null, the return value can be retrieved with the following code:
ExceptionInstantiationException
- An exception occurred while trying to re-create the exception object.
If this exception is thrown, the relevant information can be retrieved
by using the getExceptionInfo() method followed by recursively using
the getPreviousExceptionInfo() method on the DistributedExceptionInfo
object.java.lang.Throwable getPreviousException() throws ExceptionInstantiationException
If the DistributedExceptionInfo attribute is not null, the return value can be retrieved with the following code:
ExceptionInstantiationException
- An exception occurred while trying to re-create the exception object.
If this exception is thrown, the relevant information can be retrieved
by using the getExceptionInfo() method.void printStackTrace()
If the DistributedExceptionInfo attribute is not null, the the following code will accomplish this:
void printStackTrace(java.io.PrintWriter pw)
If the DistributedExceptionInfo attribute is not null, the the following code will accomplish this:
pw
- java.io.PrintWritervoid printSuperStackTrace(java.io.PrintWriter pw)
param
- java.io.PrintWriter
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |