com.ibm.websphere.exception

Interface DistributedExceptionEnabled

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      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

      • getException

        java.lang.Throwable getException(java.lang.String exceptionClassName)
                                         throws ExceptionInstantiationException
        Get a specific exception in a possible chain of exceptions. If there are multiple exceptions in the chain, the most recent one thrown will be returned. If the exception does not exist or no exceptions have been chained, null will be returned.
        If the DistributedExceptionInfo attribute is not null, the return value can be retrieved with the following code:

        distributedExceptionInfo.getException(exceptionClassName);

        Parameters:
        String - exceptionClassName: The class name of the specific exception.
        Returns:
        java.lang.Throwable: The specific exception in a chain of exceptions.
        Throws:
        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.
      • getExceptionInfo

        DistributedExceptionInfo getExceptionInfo()
        Retrieve the exception info for this exception.
        This could be coded as:

        return distributedExceptionInfo;

        Returns:
        com.ibm.websphere.exception.DistributedExceptionInfo
      • getMessage

        java.lang.String getMessage()
        Retrieve the message for this exception.
        The following is an example of the code that should be used:

        if (distributedExceptionInfo != null)

        return distributedExceptionInfo.getMessage();

        else

        return null

        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.

        Returns:
        java.lang.String
      • getOriginalException

        java.lang.Throwable getOriginalException()
                                                 throws ExceptionInstantiationException
        Get the original exception in a possible chain of exceptions. If no previous exceptions have been chained, null will be returned.
        If the DistributedExceptionInfo attribute is not null, the return value can be retrieved with the following code:

        distributedExceptionInfo.getOriginalException();

        Returns:
        java.lang.Throwable: The first exception in a chain of exceptions. If no exceptions have been chained, null will be returned.
        Throws:
        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.
      • getPreviousException

        java.lang.Throwable getPreviousException()
                                                 throws ExceptionInstantiationException
        Get the previous exception, in a possible chain of exceptions.
        If the DistributedExceptionInfo attribute is not null, the return value can be retrieved with the following code:

        distributedExceptionInfo.getPreviousException();

        Returns:
        java.lang.Throwable: The previous exception. If there was no previous exception, null will be returned.
        Throws:
        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.
      • printStackTrace

        void printStackTrace()
        Print the stack trace for this exception and all chained exceptions. This will include the stack trace from the location where the exception was created, as well as the stack traces of previous exceptions in the exception chain.
        If the DistributedExceptionInfo attribute is not null, the the following code will accomplish this:

        distributedExceptionInfo.printStackTrace();

      • printStackTrace

        void printStackTrace(java.io.PrintWriter pw)
        Print the exception execution stack to a print writer. This will include the stack trace from the location where the exception was created, as well as the stack traces of previous exceptions in the exception chain.
        If the DistributedExceptionInfo attribute is not null, the the following code will accomplish this:

        distributedExceptionInfo.printStackTrace(pw);

        Parameters:
        pw - java.io.PrintWriter
      • printSuperStackTrace

        void printSuperStackTrace(java.io.PrintWriter pw)
        This method is called by DistributedExceptionInfo to retrieve and save the current stack trace.

        super.printStackTrace(pw)

        Parameters:
        param - java.io.PrintWriter
IBM WebSphere Application ServerTM
Release 8.5