Reference > WebSphere Commerce API > com.ibm.commerce.exception > Classes
com.ibm.commerce.exception
Class ECException
java.lang.ObjectCommandException
com.ibm.commerce.exception.ECException
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- ECApplicationException, ECSystemException
public abstract class ECException
- extends CommandException
- implements java.io.Serializable
This is an abstract base class used for defining exceptions thrown by the WebSphere Commerce Application Server.
Field Summary static java.lang.String APPLICATION_ERROR
Default value of the application error parameter.static java.lang.String ECMESSAGE
Default value of the message parameter.static java.lang.String ECMESSAGEKEY
Default value of the message key parameter.protected TypedProperty errorProperties
static java.lang.String EXCEP_DATA
Default value of the exception data parameter.static java.lang.String EXCEP_TYPE
Default value of the exception type parameter.static java.lang.String EXCEPTION
Default value of the exception parameter.static java.lang.String GENERIC_APPLICATION_ERROR_TASK
Default value of the generic application error task parameter.static java.lang.String GENERIC_SYSTEM_ERROR_TASK
Default value of the generic application error task parameter.static java.lang.String MSG_PARAM
Default value of the message parameter.static java.lang.String SYSTEM_ERROR
Default value of the system error task parameter.
Constructor Summary ECException()
This is the default constructor for this class.ECException(ECMessage msg)
This is a constructor for this class with one parameter.ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam)
This is a constructor for this class with three parameters.ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, boolean logMessage)
This is a constructor for this class with five parameters.ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.String errorTaskName)
This is a constructor for this class with five parameters.ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.String errorTaskName, boolean logMsg)
This is a constructor for this class with six parameters.protected ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.String errorTaskName, java.lang.String[] symptomData, ECParameterError[] parameterErrors, java.lang.Throwable throwable, boolean logMsg)
This is a constructor for this class with six parameters.ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.String errorTaskName)
This is a constructor for this class with four parameters.ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.String errorTaskName, boolean logMessage)
This is a constructor for this class with five parameters.ECException(java.lang.String message)
This is a constructor for this class with one parameter.
Method Summary void addLogData(java.util.Map logData)
This method adds additional data for logging the exception.void addLogData(java.lang.String name, java.lang.Object value)
This method adds additional data for logging the exception.java.lang.String getCorrelationIdentifier()
This method returns the correlation identifier for the exception.ECMessage getECMessage()
This method returns an ECMessage object associated with the exception.ECParameterError[] getECParameterErrors()
This method returns the ECParameterError objects associated with the exception.java.lang.String getErrorMessageKey()
This method gets the error message key.TypedProperty getErrorProperties()
This method gets a set of error parameters.java.lang.String getErrorTaskName()
This method gets the error task name.abstract java.lang.String getErrorType()
This method gets the type of error.abstract java.lang.String getGenericErrorTask()
This method gets the generic error task.java.lang.String getMessage()
This method returns the localized message of the exception.java.lang.String getMessageKey()
This method gets the error message key.java.lang.Object[] getMessageParameters()
This method returns the message parameters.static java.lang.String getStackTrace(java.lang.Throwable exc)
This method gets the stack trace as a String object.java.lang.String[] getSymptomData()
This method returns the symptom data.java.lang.Throwable getThrowable()
This method gets the ECException object associated with this exception.java.lang.String getUserMessage(java.util.Locale loc)
This method gets the user message.boolean isRecoverable()
This method determines whether the exception is recoverable.protected void logMessage(ECMessage msg, java.lang.String className, java.lang.String methodName)
This method logs a message.protected void logMessage(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam)
This method logs a message.protected void logMessage(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.Throwable throwable)
This method logs a message.void printStackTrace(java.io.PrintStream output)
This method prints a stack trace and includes the correlation identifier and log data with the stack trace.void printStackTrace(java.io.PrintWriter output)
This method prints the stack trace and includes the correlation identifier and log data with the stack trace.void setErrorTaskName(java.lang.String viewtask)
This method sets the error view task name for this exception.void setException(java.lang.Throwable exc)
This method sets the Exception object associated with this exception.void setOrginatingCommand(java.lang.String value)
This method sets the name of the command that throws this exception.void setRecoverable(boolean recoverable)
This method sets whether the exception is recoverable.void setThrowable(java.lang.Throwable exc)
This method sets the Exception object associated with this exception.
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
GENERIC_APPLICATION_ERROR_TASK
public static final java.lang.String GENERIC_APPLICATION_ERROR_TASK
- Default value of the generic application error task parameter.
- See Also:
- Constant Field Values
GENERIC_SYSTEM_ERROR_TASK
public static final java.lang.String GENERIC_SYSTEM_ERROR_TASK
- Default value of the generic application error task parameter.
- See Also:
- Constant Field Values
EXCEP_TYPE
public static final java.lang.String EXCEP_TYPE
- Default value of the exception type parameter.
- See Also:
- Constant Field Values
EXCEP_DATA
public static final java.lang.String EXCEP_DATA
- Default value of the exception data parameter.
- See Also:
- Constant Field Values
MSG_PARAM
public static final java.lang.String MSG_PARAM
- Default value of the message parameter.
- See Also:
- Constant Field Values
ECMESSAGE
public static final java.lang.String ECMESSAGE
- Default value of the message parameter.
- See Also:
- Constant Field Values
ECMESSAGEKEY
public static final java.lang.String ECMESSAGEKEY
- Default value of the message key parameter.
- See Also:
- Constant Field Values
EXCEPTION
public static final java.lang.String EXCEPTION
- Default value of the exception parameter.
- See Also:
- Constant Field Values
APPLICATION_ERROR
public static final java.lang.String APPLICATION_ERROR
- Default value of the application error parameter.
- See Also:
- Constant Field Values
SYSTEM_ERROR
public static final java.lang.String SYSTEM_ERROR
- Default value of the system error task parameter.
- See Also:
- Constant Field Values
errorProperties
protected TypedProperty errorProperties
Constructor Detail
ECException
public ECException()
- This is the default constructor for this class.
ECException
public ECException(java.lang.String message)
- This is a constructor for this class with one parameter.
- Parameters:
- message - The String used for describing the exception.
ECException
public ECException(ECMessage msg)
- This is a constructor for this class with one parameter.
- Parameters:
- msg - An ECMessage object used for describing the exception.
ECException
public ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam)
- This is a constructor for this class with three parameters.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECApplicationException.
- methodName - The name of the method that threw this ECApplicationException.
- msgParam - An Object 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, java.lang.String errorTaskName)
- This is a constructor for this class with five parameters.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECApplicationException.
- methodName - The name of the method that threw this ECApplicationException.
- msgParam - An Object array of parameter values to be passed to the message.
- errorTaskName - 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)
- This is a constructor for this class with four parameters.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECApplicationException.
- methodName - The name of the method that threw this ECApplicationException.
- errorTaskName - 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, boolean logMessage)
- This is a constructor for this class with five parameters.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECApplicationException.
- methodName - The name of the method that threw this ECApplicationException.
- msgParam - An Object array of parameter values to be passed to the message.
- logMessage - A boolean value representing whether an error message is logged immediately (true if it is, false otherwise).
ECException
public ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.String errorTaskName, boolean logMessage)
- This is a constructor for this class with five parameters.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECApplicationException.
- methodName - The name of the method that threw this ECApplicationException.
- errorTaskName - The name of the exception handler to handle this message.
- logMessage - A boolean value representing whether an error message is logged immediately (true if it is, false otherwise).
ECException
public ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.String errorTaskName, boolean logMsg)
- This is a constructor for this class with six parameters.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECApplicationException.
- methodName - The name of the method that threw this ECApplicationException.
- msgParam - An Object array of parameter values to be passed to the message.
- errorTaskName - The name of the exception handler to handle this message.
- logMessage - A boolean value representing whether an error message is logged immediately (true if it is, false otherwise).
ECException
protected ECException(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] msgParam, java.lang.String errorTaskName, java.lang.String[] symptomData, ECParameterError[] parameterErrors, java.lang.Throwable throwable, boolean logMsg)
- This is a constructor for this class with six parameters.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECApplicationException.
- methodName - The name of the method that threw this ECApplicationException.
- msgParam - An Object array of parameter values to be passed to the message.
- errorTaskName - The name of the exception handler to handle this message.
- logMessage - A boolean value representing whether an error message is logged immediately (true if it is, false otherwise).
Method Detail
getErrorMessageKey
public java.lang.String getErrorMessageKey()
- This method gets the error message key.
- Returns:
- The error message key.
getErrorProperties
public TypedProperty getErrorProperties()
- This method gets a set of error parameters.
- Returns:
- A TypedProperty object representing the error properties.
getErrorTaskName
public java.lang.String getErrorTaskName()
- This method gets the error task name.
- Returns:
- The error task name.
getErrorType
public abstract java.lang.String getErrorType()
- This method gets the type of error.
- Returns:
- The error type.
getGenericErrorTask
public abstract java.lang.String getGenericErrorTask()
- This method gets the generic error task.
- Returns:
- The generic error task.
getMessageKey
public java.lang.String getMessageKey()
- This method gets the error message key.
- Returns:
- The error message key.
getStackTrace
public static java.lang.String getStackTrace(java.lang.Throwable exc)
- This method gets the stack trace as a String object.
- Parameters:
- exc - A Throwable object.
getThrowable
public java.lang.Throwable getThrowable()
- This method gets the ECException object associated with this exception.
- Returns:
- The ECException object.
getUserMessage
public java.lang.String getUserMessage(java.util.Locale loc)
- This method gets the user message.
- Returns:
- The user message.
logMessage
protected void logMessage(ECMessage msg, java.lang.String className, java.lang.String methodName)
- This method logs a message.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECException .
- methodName - 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)
- This method logs a message.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECException .
- methodName - The name of the method that threw this ECException.
- msgParam - An Object array to be passed as a parameter 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)
- This method logs a message.
To overwrite the implementation for logMessage, only this method needs to be implemented. All the other logMessage methods call this method.
- Parameters:
- msg - An ECMessage object used for describing the exception.
- className - The name of the class that threw this ECException .
- methodName - The name of the method that threw this ECException.
- msgParam - An Object array to be passed as a parameter to the message.
- throwable - A Throwable object.
setErrorTaskName
public void setErrorTaskName(java.lang.String viewtask)
- This method sets the error view task name for this exception.
- Parameters:
- viewtask - The name of the error view task.
setException
public void setException(java.lang.Throwable exc)
- This method sets the Exception object associated with this exception.
- Parameters:
- exc - A Throwable object.
setOrginatingCommand
public void setOrginatingCommand(java.lang.String value)
- This method sets the name of the command that throws this exception.
- Parameters:
- value - The name of the command.
setThrowable
public void setThrowable(java.lang.Throwable exc)
- This method sets the Exception object associated with this exception.
- Parameters:
- exc - The Throwable object.
getECParameterErrors
public ECParameterError[] getECParameterErrors()
- This method returns the ECParameterError objects associated with the exception.
- Returns:
- An array of ECParameterError objects.
getECMessage
public ECMessage getECMessage()
- This method returns an ECMessage object associated with the exception.
- Returns:
- An ECMessage object associated with the exception.
getMessageParameters
public java.lang.Object[] getMessageParameters()
- This method returns the message parameters.
- Returns:
- The message parameters.
getSymptomData
public java.lang.String[] getSymptomData()
- This method returns the symptom data.
- Returns:
- The symptom data.
getCorrelationIdentifier
public java.lang.String getCorrelationIdentifier()
- This method returns the correlation identifier for the exception.
- Returns:
- The correlation identifier.
isRecoverable
public boolean isRecoverable()
- This method determines whether the exception is recoverable. An exception is recoverable if the request that caused the exception could be successful the next time it is executed by the initial client. This occurs in the cases where the ECException is a response to an exception caused by concurrency control (that is, TransactionRollback because of database deadlocks), and not related to either system configuration or attributes.
- Returns:
- A boolean value indicating whether the request should be retried (true if it should, false otherwise).
setRecoverable
public void setRecoverable(boolean recoverable)
- This method sets whether the exception is recoverable. The default behavior of the exception is false.
- Parameters:
- recoverable - Whether the exception is recoverable.
addLogData
public void addLogData(java.util.Map logData)
- This method adds additional data for logging the exception.
- Parameters:
- logData - The additional logging data.
addLogData
public void addLogData(java.lang.String name, java.lang.Object value)
- This method adds additional data for logging the exception.
- Parameters:
- name - The name of the log data.
- value - The value of the log data.
printStackTrace
public void printStackTrace(java.io.PrintStream output)
- This method prints a stack trace and includes the correlation identifier and log data with the stack trace.
- Parameters:
- output - Indicates where to write the stack trace and other output.
- See Also:
- Throwable.printStackTrace(java.io.PrintStream)
printStackTrace
public void printStackTrace(java.io.PrintWriter output)
- This method prints the stack trace and includes the correlation identifier and log data with the stack trace.
- Parameters:
- output - Indicates where to write the stack trace and other output.
- See Also:
- Throwable.printStackTrace(java.io.PrintWriter)
getMessage
public java.lang.String getMessage()
- This method returns the localized message of the exception.
- Returns:
- The message associated with the exception.
- See Also:
- Throwable.getMessage()
_vcc_freeselect_bottom_