com.ibm.commerce.exception
Class ECException

com.ibm.commerce.exception.ECException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ECApplicationException, ECSystemException

public abstract class ECException
implements java.io.Serializable

ECException is the abstract base class used for defining exceptions thrown by the WebSphere Commerce Application Server.

See Also:
Serialized Form

Field Summary
static java.lang.String APPLICATION_ERROR
           
static java.lang.String ECMESSAGE
           
static java.lang.String ECMESSAGEKEY
           
protected  TypedProperty errorProperties
           
static java.lang.String EXCEP_DATA
           
static java.lang.String EXCEP_TYPE
           
static java.lang.String EXCEPTION
           
static java.lang.String GENERIC_APPLICATION_ERROR_TASK
           
static java.lang.String GENERIC_SYSTEM_ERROR_TASK
           
static java.lang.String MSG_PARAM
           
static java.lang.String SYSTEM_ERROR
           
 
Constructor Summary
ECException()
          Constructs an ECException with an ECMessage object.
ECException(ECMessage msg)
          Constructs an ECException with an ECMessage object.
ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam)
          Constructs an ECApplicationException with an ECMessage object.
ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, boolean logMessage)
          Constructs an ECApplicationException with an ECMessage object.
ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.String errorTaskName)
          Constructs an ECApplicationException with an ECMessage object.
ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.String errorTaskName, boolean logMsg)
          Constructs an ECApplicationException with an ECMessage object.
ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.String errorTaskName)
          Constructs an ECApplicationException with an ECMessage object.
ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.String errorTaskName, boolean logMessage)
          Constructs an ECApplicationException with an ECMessage object.
ECException(java.lang.String message)
          Constructs an ECException with an ECMessage object.
 
Method Summary
 java.lang.String getErrorMessageKey()
          Gets the error message key
 TypedProperty getErrorProperties()
          Gets the sets of error parameters
 java.lang.String getErrorTaskName()
          Gets the error task name
abstract  java.lang.String getErrorType()
          Gets the type of error.
abstract  java.lang.String getGenericErrorTask()
          Gets the generic error task
 java.lang.String getMessageKey()
          Gets the error message key
static java.lang.String getStackTrace(java.lang.Throwable exc)
          Return the Stack Trace as a String.
 java.lang.Throwable getThrowable()
          Gets the ECException object associated with this exception.
 java.lang.String getUserMessage(java.util.Locale loc)
          Gets the user message
protected  void logMessage(ECMessage msg, java.lang.String className, java.lang.String methodName)
          Method to log a message
protected  void logMessage(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam)
          Method to log a message
protected  void logMessage(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.Throwable throwable)
          Method to log a message
 void setErrorTaskName(java.lang.String viewtask)
          Sets the error view task name for this exception.
 void setException(java.lang.Throwable exc)
          Sets the Exception object associated with this exception.
 void setOrginatingCommand(java.lang.String value)
          Sets the name of the command which throws this exception.
 void setThrowable(java.lang.Throwable exc)
          Sets the Exception object associated with this exception.
 

Field Detail

APPLICATION_ERROR

public static final java.lang.String APPLICATION_ERROR

ECMESSAGE

public static final java.lang.String ECMESSAGE

ECMESSAGEKEY

public static final java.lang.String ECMESSAGEKEY

errorProperties

protected TypedProperty errorProperties

EXCEP_DATA

public static final java.lang.String EXCEP_DATA

EXCEP_TYPE

public static final java.lang.String EXCEP_TYPE

EXCEPTION

public static final java.lang.String EXCEPTION

GENERIC_APPLICATION_ERROR_TASK

public static final java.lang.String GENERIC_APPLICATION_ERROR_TASK

GENERIC_SYSTEM_ERROR_TASK

public static final java.lang.String GENERIC_SYSTEM_ERROR_TASK

MSG_PARAM

public static final java.lang.String MSG_PARAM

SYSTEM_ERROR

public static final java.lang.String SYSTEM_ERROR
Constructor Detail

ECException

public ECException()
Constructs an ECException with an ECMessage object.

ECException

public ECException(ECMessage msg)
Constructs an ECException with an ECMessage object.
Parameters:
msg - The ECMessage object used for describing the exception.

ECException

public ECException(ECMessage msg,
                   java.lang.String className,
                   java.lang.String methodName,
                   java.lang.Object[] msgParam)
Constructs an ECApplicationException with an ECMessage object.
Parameters:
msg - ECMessage - The ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECApplicationException.
methodName - String - The name of the method that threw this ECApplicationException.
msgParam - Object[] - An array of parameter values to be passed to the message.

ECException

public ECException(ECMessage msg,
                   java.lang.String className,
                   java.lang.String methodName,
                   java.lang.Object[] msgParam,
                   boolean logMessage)
Constructs an ECApplicationException with an ECMessage object.
Parameters:
msg - ECMessage - The ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECApplicationException.
methodName - String - The name of the method that threw this ECApplicationException.
msgParam - Object[] - An array of parameter values to be passed to the message.
logMessage - boolean - indicate that an error message is logged immediately

ECException

public ECException(ECMessage msg,
                   java.lang.String className,
                   java.lang.String methodName,
                   java.lang.Object[] msgParam,
                   java.lang.String errorTaskName)
Constructs an ECApplicationException with an ECMessage object.
Parameters:
msg - ECMessage - The ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECApplicationException.
methodName - String - The name of the method that threw this ECApplicationException.
msgParam - Object[] - An array of parameter values to be passed to the message.
errorTaskName - String - The name of the exception handler to handle this message.

ECException

public ECException(ECMessage msg,
                   java.lang.String className,
                   java.lang.String methodName,
                   java.lang.Object[] msgParam,
                   java.lang.String errorTaskName,
                   boolean logMsg)
Constructs an ECApplicationException with an ECMessage object.
Parameters:
msg - ECMessage - The ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECApplicationException.
methodName - String - The name of the method that threw this ECApplicationException.
msgParam - Oject[] - An array of parameter values to be passed to the message.
errorTaskName - String - The name of the exception handler to handle this message.
logMessage - boolean - indicate that an error message is logged immediately

ECException

public ECException(ECMessage msg,
                   java.lang.String className,
                   java.lang.String methodName,
                   java.lang.String errorTaskName)
Constructs an ECApplicationException with an ECMessage object.
Parameters:
msg - ECMessage - The ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECApplicationException.
methodName - String - The name of the method that threw this ECApplicationException.
errorTaskName - String - The name of the exception handler to handle this message.

ECException

public ECException(ECMessage msg,
                   java.lang.String className,
                   java.lang.String methodName,
                   java.lang.String errorTaskName,
                   boolean logMessage)
Constructs an ECApplicationException with an ECMessage object.
Parameters:
msg - ECMessage - TThe ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECApplicationException.
methodName - String - The name of the method that threw this ECApplicationException.
errorTaskName - String - The name of the exception handler to handle this message.
logMessage - boolean - indicate that an error message is logged immediately

ECException

public ECException(java.lang.String message)
Constructs an ECException with an ECMessage object.
Parameters:
message - The string used for describing the exception.
Method Detail

getErrorMessageKey

public java.lang.String getErrorMessageKey()
Gets the error message key
Returns:
String - the error message key.

getErrorProperties

public TypedProperty getErrorProperties()
Gets the sets of error parameters
Returns:
TypedProperty - the nvp of all the error properties.

getErrorTaskName

public java.lang.String getErrorTaskName()
Gets the error task name
Returns:
String - the error task name.

getErrorType

public abstract java.lang.String getErrorType()
Gets the type of error.
Returns:
(java.lang.String) The error type.

getGenericErrorTask

public abstract java.lang.String getGenericErrorTask()
Gets the generic error task
Returns:
(java.lang.String) The generic error task.

getMessageKey

public java.lang.String getMessageKey()
Gets the error message key
Returns:
String - the error message key.

getStackTrace

public static java.lang.String getStackTrace(java.lang.Throwable exc)
Return the Stack Trace as a String.
Parameters:
exc - The Throwable object.

getThrowable

public java.lang.Throwable getThrowable()
Gets the ECException object associated with this exception.
Returns:
Throwable The ECException object.

getUserMessage

public java.lang.String getUserMessage(java.util.Locale loc)
Gets the user message
Returns:
String - the user message.

logMessage

protected void logMessage(ECMessage msg,
                          java.lang.String className,
                          java.lang.String methodName)
Method to log a message
Parameters:
msg - ECMessage - The ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECException.
methodName - String - The name of the method that threw this ECException.

logMessage

protected void logMessage(ECMessage msg,
                          java.lang.String className,
                          java.lang.String methodName,
                          java.lang.Object[] msgParam)
Method to log a message
Parameters:
msg - ECMessage - The ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECException.
methodName - String - The name of the method that threw this ECException.
msgParam - array of object to be passed as parameters to the message.

logMessage

protected void logMessage(ECMessage msg,
                          java.lang.String className,
                          java.lang.String methodName,
                          java.lang.Object[] msgParam,
                          java.lang.Throwable throwable)
Method to log a message
Parameters:
msg - ECMessage - The ECMessage object used for describing the exception.
className - String - The name of the class that threw this ECException.
methodName - String - The name of the method that threw this ECException.
msgParam - Object[] - array of object to be passed as parameters to the message.
throwable - the throwable object.

setErrorTaskName

public void setErrorTaskName(java.lang.String viewtask)
Sets the error view task name for this exception.
Parameters:
viewtask - - name of the error view task.

setException

public void setException(java.lang.Throwable exc)
Sets the Exception object associated with this exception.
Parameters:
exc - The Throwable object.

setOrginatingCommand

public void setOrginatingCommand(java.lang.String value)
Sets the name of the command which throws this exception.
Parameters:
value - The name of the command.

setThrowable

public void setThrowable(java.lang.Throwable exc)
Sets the Exception object associated with this exception.
Parameters:
exc - The Throwable object.