Class DistributedExceptionInfo

java.lang.Object
com.ibm.websphere.exception.DistributedExceptionInfo
All Implemented Interfaces:
Serializable

public class DistributedExceptionInfo extends Object implements Serializable
Does the work for exception classes that implement the DistributedExceptionEnabled interface.
See Also:
  • Constructor Details

    • DistributedExceptionInfo

      public DistributedExceptionInfo(DistributedExceptionEnabled currentException)
      Constructor with current exception
      Parameters:
      currentException - java.lang.Throwable
    • DistributedExceptionInfo

      public DistributedExceptionInfo(DistributedExceptionEnabled currentException, Throwable previousException)
      Constructor with the current and previous exceptions
      Parameters:
      currentException - java.lang.Throwable
      previousException - java.lang.Throwable
    • DistributedExceptionInfo

      public DistributedExceptionInfo(String defaultMessage, DistributedExceptionEnabled currentException)
      Constructor with current exception
      Parameters:
      currentException - java.lang.Throwable
    • DistributedExceptionInfo

      public DistributedExceptionInfo(String defaultMessage, DistributedExceptionEnabled currentException, Throwable previousException)
      Constructor with current exception
      Parameters:
      currentException - java.lang.Throwable
    • DistributedExceptionInfo

      public DistributedExceptionInfo(String resourceBundleName, String resourceKey, Object[] formatArguments, String defaultText, DistributedExceptionEnabled currentException)
      Constructor with localization message information and the current exception..
      Parameters:
      resourceBundleName - java.lang.String The name of resource bundle that will be used to retrieve the message for getMessage().
      resourceKey - java.lang.String The key in the resource bundle that will be used to select the specific message that is retrieved for getMessage().
      formatArguments - java.lang.Object[] The arguments to be passed to the MessageFormat class to act as replacement variables in the message that is retrieved from the resource bundle. Valid types are those supported by MessageFormat.
      defaultText - java.lang.String The default message that will be used in getMessage() if the resource bundle or the key cannot be found
      currentException - DistributedExceptionEnabled The current exception
      See Also:
    • DistributedExceptionInfo

      public DistributedExceptionInfo(String resourceBundleName, String resourceKey, Object[] formatArguments, String defaultText, DistributedExceptionEnabled currentException, Throwable previousException)
      Constructor with localization message information and the current exception..
      Parameters:
      resourceBundleName - java.lang.String The name of resource bundle that will be used to retrieve the message for getMessage().
      resourceKey - java.lang.String The key in the resource bundle that will be used to select the specific message that is retrieved for getMessage().
      formatArguments - java.lang.Object[] The arguments to be passed to the MessageFormat class to act as replacement variables in the message that is retrieved from the resource bundle. Valid types are those supported by MessageFormat.
      defaultText - java.lang.String The default message that will be used in getMessage() if the resource bundle or the key cannot be found
      currentException - DistributedExceptionEnabled The current exception
      previousException - java.lang.Throwable The chained exception
      See Also:
  • Method Details

    • getClassName

      public String getClassName()
      Get the class name for this exception.
      Returns:
      java.lang.String The class name
    • getDefaultMessage

      public String getDefaultMessage()
      Get the default message for this exception
      Returns:
      java.lang.String The default message
    • getException

      public Throwable getException(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 exceptions does not exist or no exceptions have been chained, null will be returned.
      Parameters:
      String - exceptionClassName the class name of the specific exception.
      Returns:
      java.lang.Throwable The specific exception in a chain of exceptions. If no exceptions have been chained, null will be returned.
      Throws:
      ExceptionInstantiationException - An exception occurred while trying to instantiate an exception object. If this exception is thrown, the relevant information can be retrieved using the getPreviousExceptionInfo() method.
    • getFormatArguments

      public Object[] getFormatArguments()
      Get the format arguments.
      Returns:
      java.lang.Object[] The format arguments
    • getMessage

      public String getMessage()
      Retrieve the text message for this exception. The default message (which may be null) will be returned in any of the following situations:
      • No resource bundle name exists
      • No resource key exists
      • The resource bundle could not be found
      • The key was not found in the resource bundle
      Returns:
      java.lang.String message for this exception
    • getOriginalException

      public 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.
      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 instantiate an exception object. If this exception is thrown, the relevant information can be retrieved by using the getPreviousExceptionInfo() method.
    • getPreviousException

      public Throwable getPreviousException() throws ExceptionInstantiationException
      Retrieves the previous exception
      Returns:
      java.lang.Throwable
      Throws:
      ExceptionInstantiationException - An exception occurred while trying to instantiate an exception object. If this exception is thrown, the relevant information can be retrieved by using the getPreviousExceptionInfo() method.
    • getPreviousExceptionInfo

      public DistributedExceptionInfo getPreviousExceptionInfo()
      Retrieve the previous exception info object. If it doesn't exist, null will be returned.
      Returns:
      com.ibm.websphere.exception.DistributedExceptionInfo
    • getResourceBundleName

      public String getResourceBundleName()
      Get the resource bundle name
      Returns:
      java.lang.String The resource bundle name
    • getResourceKey

      public String getResourceKey()
      Get the resource key that will be used to retrieve the message from the resource bundle
      Returns:
      java.lang.String
    • printStackTrace

      public void printStackTrace(PrintWriter pw)
      Print the stack trace to a print writer.

      If this exception was thrown from a remote process, the stack trace will include the stack from the remote process.
      Parameters:
      param - java.io.PrintWriter
    • setDefaultMessage

      public void setDefaultMessage(String defaultText)
      Insert the method's description here. Creation date: (2/28/00 11:26:22 AM)
      Parameters:
      defaultText - java.lang.String
    • setLocalizationInfo

      public void setLocalizationInfo(String resourceBundleName, String resourceKey, Object[] formatArguments)
      FOR WEBSPHERE INTERNAL USE ONLY Set the localization information.
      Parameters:
      resourceBundleName - java.lang.String
      resourceKey - java.lang.String
      arguments - java.lang.Object[]