com.tivoli.pd.jutil
Class PDException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.tivoli.pd.jutil.PDException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NoPDContextAvailableException

public class PDException
extends java.lang.Exception

PD Exception class.

PDException allows creating an exception which can do one or more of the following: (1) contain a specific exception string, (2) contain one or more PD message codes and associated localized strings, (3) wrap a Throwable and make it accessible via a method.

Modes: Local,Remote

See Also:
Serialized Form

Constructor Summary
PDException()
          Default constructor for a PDException.
PDException(int msgCode, java.util.Locale locale)
          Constructs a PDException with the specified message code and locale.
PDException(int msgCode, java.util.Locale locale, java.lang.Object[] args)
          Constructs a PDException with the specified message code, locale and arguments.
PDException(PDMessages pdMsgs)
          Constructs a PDException containing the specified PDMessages object.
PDException(PDMessages pdMsgs, int msgCode, java.util.Locale locale)
          Constructs a PDException with the specified PDMessages object, a specified message code, and a locale.
PDException(PDMessages pdMsgs, int msgCode, java.util.Locale locale, java.lang.Object[] args)
          Constructs a PDException with the specified PDMessages object, a specified message code, locale and arguments.
PDException(PDMessages pdMsgs, java.lang.String msg)
          Constructs a PDException containing the specified PDMessages object, and a specified detail message.
PDException(PDMessages pdMsgs, java.lang.String msg, java.lang.Throwable t)
          Constructs a PDException with the specified detail message, specified PDMessages object, and the specified Throwable.
PDException(PDMessages pdMsgs, java.lang.Throwable t)
          Constructs a PDException with the specified PDMessages object, and a specified Throwable.
PDException(java.lang.String msg)
          Constructs a PDException with the specified detail message.
PDException(java.lang.String msg, java.lang.Throwable t)
          Constructs a PDException with the specified detail message and the specified Throwable.
PDException(java.lang.Throwable t)
          Constructs a PDException that wraps the specified Throwable.
 
Method Summary
 java.lang.Throwable getCause()
          Returns the wrapped Throwable.
 PDMessages getMessages()
          Returns a copy of the PDMessages object stored in this PDException.
 void printStackTrace()
          Prints the stack trace for the exception and any wrapped exceptions contained in it.
 java.lang.String toString()
          Returns a string representation of this Exception, containing the string representation of the wrapped Throwable (if any), the detail message (if any), and the PDMessages object (if any).
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDException

public PDException()
Default constructor for a PDException.


PDException

public PDException(java.lang.String msg)
Constructs a PDException with the specified detail message.

Parameters:
msg - message for this exception.

PDException

public PDException(PDMessages pdMsgs)
Constructs a PDException containing the specified PDMessages object.

Parameters:
pdMsgs - PDMessages object that contain messages that need to be stored in this exception.

PDException

public PDException(java.lang.Throwable t)
Constructs a PDException that wraps the specified Throwable.

Parameters:
t - Throwable that needs to be wrapped.

PDException

public PDException(PDMessages pdMsgs,
                   java.lang.String msg)
Constructs a PDException containing the specified PDMessages object, and a specified detail message.

Parameters:
pdMsgs - PDMessages object that contain messages that need to be stored in this exception.
msg - Detail message for this exception.

PDException

public PDException(java.lang.String msg,
                   java.lang.Throwable t)
Constructs a PDException with the specified detail message and the specified Throwable.

Parameters:
msg - the detail message.
t - Throwable that needs to be wrapped.

PDException

public PDException(PDMessages pdMsgs,
                   java.lang.Throwable t)
Constructs a PDException with the specified PDMessages object, and a specified Throwable.

Parameters:
pdMsgs - PDMessages object that contain messages that need to be stored in this exception.
t - Throwable that needs to be wrapped.

PDException

public PDException(PDMessages pdMsgs,
                   java.lang.String msg,
                   java.lang.Throwable t)
Constructs a PDException with the specified detail message, specified PDMessages object, and the specified Throwable.

Parameters:
pdMsgs - PDMessages object that contain messages that need to be stored in this exception.
msg - the detail message.
t - Throwable that needs to be wrapped.

PDException

public PDException(int msgCode,
                   java.util.Locale locale)
Constructs a PDException with the specified message code and locale.

Parameters:
msgCode - PD message code.
locale - Locale for any data that is returned.

PDException

public PDException(int msgCode,
                   java.util.Locale locale,
                   java.lang.Object[] args)
Constructs a PDException with the specified message code, locale and arguments.

Parameters:
msgCode - PD message code.
locale - Locale for any data that is returned.
args - Arguments for the message specified by the message code. Pass in null if there are no arguments.

PDException

public PDException(PDMessages pdMsgs,
                   int msgCode,
                   java.util.Locale locale)
Constructs a PDException with the specified PDMessages object, a specified message code, and a locale.

Parameters:
pdMsgs - PDMessages object that contain messages that need to be stored in this exception.
msgCode - PD message code.
locale - Locale for any data that is returned.

PDException

public PDException(PDMessages pdMsgs,
                   int msgCode,
                   java.util.Locale locale,
                   java.lang.Object[] args)
Constructs a PDException with the specified PDMessages object, a specified message code, locale and arguments.

Parameters:
pdMsgs - PDMessages object that contain messages that need to be stored in this exception.
msgCode - PD message code.
locale - Locale for any data that is returned.
args - Arguments for the message specified by the message code. Pass in null if there are no arguments.
Method Detail

getMessages

public PDMessages getMessages()
Returns a copy of the PDMessages object stored in this PDException.

Returns:
the PDMessages object stored in this object.

getCause

public java.lang.Throwable getCause()
Returns the wrapped Throwable.

Overrides:
getCause in class java.lang.Throwable
Returns:
the Throwable that this PDException wraps or null if the PDException does not wrap any Throwable.

printStackTrace

public void printStackTrace()
Prints the stack trace for the exception and any wrapped exceptions contained in it.

Overrides:
printStackTrace in class java.lang.Throwable

toString

public java.lang.String toString()
Returns a string representation of this Exception, containing the string representation of the wrapped Throwable (if any), the detail message (if any), and the PDMessages object (if any).

Overrides:
toString in class java.lang.Throwable