com.ibm.websphere.exception

Class DistributedException

  1. java.lang.Object
  2. extended byjava.lang.Throwable
  3. extended byjava.lang.Exception
  4. extended bycom.ibm.websphere.exception.DistributedException
All implemented interfaces:
DistributedExceptionEnabled, java.io.Serializable
Direct known subclasses:
CommandException, ExceptionInstantiationException, WorkAreaException

  1. public class DistributedException
  2. extends java.lang.Exception
  3. implements DistributedExceptionEnabled
Provides exception functions desirable in a distributed environment. This includes the following:
See Also:
Serialized Form

Constructor Summary

Constructor and Description
DistributedException()
Default constructor.
DistributedException(java.lang.String message)
Constructor with a message.
DistributedException(java.lang.String resourceBundleName,java.lang.String resourceKey,java.lang.Object[] formatArguments,java.lang.String defaultText)
Constructor with localization message information.
DistributedException(java.lang.String resourceBundleName,java.lang.String resourceKey,java.lang.Object[] formatArguments,java.lang.String defaultText,java.lang.Throwable exception)
Constructor with localization message information and an exception to be chained.
DistributedException(java.lang.String message,java.lang.Throwable exception)
Constructor with a message and an exception to be chained.
DistributedException(java.lang.Throwable exception)
Constructor with an exception to be chained.

Method Summary

Modifier and Type Method and Description
  1. java.lang.Throwable
getException(java.lang.String exceptionClassName)
Get a specific exception in a possible chain of exceptions.
  1. DistributedExceptionInfo
getExceptionInfo()
Retrieve the DistributedExceptionInfo object.
  1. java.lang.String
getMessage()
Retrieve the text message for this exception.
  1. java.lang.Throwable
getOriginalException()
Get the original exception in a possible chain of exceptions.
  1. java.lang.Throwable
getPreviousException()
Get the previous exception.
  1. void
printStackTrace()
Print the exception execution stack.
  1. void
printStackTrace(java.io.PrintStream ps)
Print the exception execution stack.
  1. void
printStackTrace(java.io.PrintWriter pw)
Print the exception execution stack to a print writer.
  1. void
printSuperStackTrace(java.io.PrintStream ps)
This method is used to get the stack trace of the current exception.
  1. void
printSuperStackTrace(java.io.PrintWriter pw)
This method is used to get the stack trace of the current exception.
  1. void
setDefaultMessage(java.lang.String defaultText)
Set the default message for this message.
  1. void
setLocalizationInfo(java.lang.String resourceBundleName,java.lang.String resourceKey,java.lang.Object[] formatArguments)
Set the values to be used for finding the correct translated version of the message and formatting it.
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

DistributedException

  1. public DistributedException()
Default constructor.

DistributedException

  1. public DistributedException(java.lang.String message)
Constructor with a message.
Parameters:
message - java.lang.String Message text

DistributedException

  1. public DistributedException(java.lang.String resourceBundleName,
  2. java.lang.String resourceKey,
  3. java.lang.Object[] formatArguments,
  4. java.lang.String defaultText)
Constructor with localization message information.
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.
See Also:
getMessage(), MessageFormat

DistributedException

  1. public DistributedException(java.lang.String resourceBundleName,
  2. java.lang.String resourceKey,
  3. java.lang.Object[] formatArguments,
  4. java.lang.String defaultText,
  5. java.lang.Throwable exception)
Constructor with localization message information and an exception to be chained.
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.
exception - java.lang.Throwable The exception that is to be chained.
See Also:
getMessage(), MessageFormat

DistributedException

  1. public DistributedException(java.lang.String message,
  2. java.lang.Throwable exception)
Constructor with a message and an exception to be chained.
Parameters:
message - The message for this exception
exception - java.lang.Throwable The exception to be chained

DistributedException

  1. public DistributedException(java.lang.Throwable exception)
Constructor with an exception to be chained.
Parameters:
exception - java.lang.Throwable The exception to be chained

Method Detail

getException

  1. public java.lang.Throwable getException( java.lang.String exceptionClassName)
  2. 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.
Specified by:
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 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

  1. public DistributedExceptionInfo getExceptionInfo( )
Retrieve the DistributedExceptionInfo object. This object is primarily used by a CORBA, non-Java client. It also may be used by a Java client to retrieve information about a previous exception when the getPreveiousException() method throws an exception.
Specified by:
Returns:
com.ibm.websphere.exception.DistributedExceptionInfo

getMessage

  1. public java.lang.String getMessage( )
Retrieve the text message for this exception. If a resource bundle and resource key have been previously specified when the exception was created, an attempt will be made to retrieve the message from the resource bundle for the language associated with the current locale. 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
Specified by:
Overrides:
getMessage in class java.lang.Throwable
Returns:
java.lang.String message for this exception

getOriginalException

  1. public java.lang.Throwable getOriginalException( )
  2. throws ExceptionInstantiationException
Get the original exception in a possible chain of exceptions. If no previous exceptions have been chained, null will be returned.
Specified by:
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 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

  1. public java.lang.Throwable getPreviousException( )
  2. throws ExceptionInstantiationException
Get the previous exception.
Specified by:
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 instantiate the exception object. If this exception is thrown, the relevant information can be retrieved by using the getExceptionInfo() method.

printStackTrace

  1. public void printStackTrace()
Print the exception execution stack. This will include the stack trace of where the exception was created, as well as the stack traces of previous exceptions in the exception chain.
Specified by:
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

  1. public void printStackTrace(java.io.PrintWriter pw)
Print the exception execution stack to a print writer. This will include the stack trace of where the exception was created, as well as the stack traces of previous exceptions in the exception chain.
Specified by:
Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
pw - java.io.PrintWriter

printStackTrace

  1. public void printStackTrace(java.io.PrintStream ps)
Print the exception execution stack. This will include the stack trace of where the exception was created, as well as the stack traces of previous exceptions in the exception chain.
Overrides:
printStackTrace in class java.lang.Throwable

printSuperStackTrace

  1. public void printSuperStackTrace( java.io.PrintWriter pw)
This method is used to get the stack trace of the current exception. This method is called by DistributedExceptionInfo to retrieve and save the current stack trace. The information is saved and can be retrieved by printStackTrace();
Specified by:

printSuperStackTrace

  1. public void printSuperStackTrace( java.io.PrintStream ps)
This method is used to get the stack trace of the current exception. This method is called by DistributedExceptionInfo to retrieve and save the current stack trace. The information is saved and can be retrieved by printStackTrace();

setDefaultMessage

  1. public void setDefaultMessage(java.lang.String defaultText)
Set the default message for this message. This will be the message returned by getMessage() in any of the following situations:
Parameters:
defaultText - java.lang.String

setLocalizationInfo

  1. public void setLocalizationInfo( java.lang.String resourceBundleName,
  2. java.lang.String resourceKey,
  3. java.lang.Object[] formatArguments)
Set the values to be used for finding the correct translated version of the message and formatting it.
Parameters:
resourceBundleName - java.lang.String - the name of the resource bundle, which is a subclass of java.util.PropertyResourceBundle.
resourceKey - java.lang.String - the key in the resource bundle that specifies the text for the exception message
See Also:
MessageFormat