public class AdapterException extends javax.resource.ResourceException implements AdapterExceptionConstants, LocalizableException, com.wm.util.coder.IDataCodable, LoggableException
Adapter writers should
throw this exception when an error occurs with the adapter's resource and the
error is not related to a connection. Adapter writers create
AdapterExceptions using the WmAdapter
createAdapterException methods. When an error occurs in the resource that
requires a reset to a resource connection, the adapter writer should throw
AdapterConnectionException
.
AdapterException implements IDataCodable so instances of it can be
manipulated as IData by interested parties. Each of AdapterException's
properties is stored in the IData, keyed by the field names described in
AdapterExceptionConstants
and LocalizableException
.
Modifier and Type | Field and Description |
---|---|
protected AdapterResourceBundleManager |
_bundleManager
ResourceBundleManger for the resource bundle containing the error
message.
|
protected com.wm.data.IData |
_data
Internal IData object representing the contents of this adapter exception
|
protected java.util.Date |
_date
Timestamp of when the adapter error occured
|
protected java.lang.String |
_defaultMessage
Default error message that the adapter exception will return if
AdapterException.getMessage() is called.
|
protected java.lang.String |
_errorCode
Error message error code key to a localizable error message stored in
resource bundle.
|
protected java.lang.String[] |
_errorMessageArgs
Error message error code arguments needed (if any) for constructive a
locale specific error message
|
protected java.lang.String |
_errorResourceBundleName
Java class name of the resource bundle containing the error message.
|
protected java.lang.String |
_majorCode
Error message major code inserted into formatted message by getMessage()
for AdapterExceptions that only use the minor code for ResourceBundle
lookups.
|
protected java.lang.Throwable |
_throwable
The throwable object that caused the exception, if any.
|
DATE_KEY, DETAIL_KEY, EXCEPTION_CLASS_KEY, EXCEPTIONDETAIL_KEY, MESSAGE_KEY, REASON_KEY, STACK_KEY
ERRORARGS_KEY, ERRORCODE_KEY, ERRORRESOURCEBUNDLE_KEY
Constructor and Description |
---|
AdapterException(AdapterResourceBundleManager mgr,
java.lang.String errorCode,
java.lang.String[] errorMessageArgs,
com.wm.data.IData detail,
java.lang.Throwable reason)
Constructor using an AdapterResourceBundleManager.
|
AdapterException(AdapterResourceBundleManager mgr,
java.lang.String majorCode,
java.lang.String errorCode,
java.lang.String[] errorMessageArgs,
com.wm.data.IData detail,
java.lang.Throwable reason)
Constructor using an AdapterResourceBundleManager.
|
AdapterException(AdapterResourceBundleManager mgr,
java.lang.String majorCode,
java.lang.String errorCode,
java.lang.String[] errorMessageArgs,
com.wm.data.IData detail,
java.lang.Throwable reason,
boolean log)
Constructor using an AdapterResourceBundleManager.
|
AdapterException(int majorCode,
int minorCode,
java.lang.String[] errorMessageArgs,
AdapterResourceBundleManager mgr,
com.wm.data.IData detail,
java.lang.Throwable t)
Constructor using an AdapterResourceBundleManager.
|
AdapterException(int majorCode,
int minorCode,
java.lang.String[] errorMessageArgs,
java.lang.String bundleName,
com.wm.data.IData detail,
java.lang.Throwable t)
Constructor using an AdapterResourceBundleName.
|
AdapterException(java.lang.String message,
com.wm.data.IData detail,
java.lang.Throwable reason)
Internal use only constructor for constructing an AdapterException
without using a Resource Bundle As it is not I18N compliant, it should
only be used for errors relating to ResourceBundle problems.
|
AdapterException(java.lang.String defaultMessage,
java.lang.String errorCode,
java.lang.String[] errorMessageArgs,
java.lang.String errorResourceBundleName,
com.wm.data.IData detail,
java.lang.Throwable reason)
This constructor gives full control of the AdapterException content.
|
Modifier and Type | Method and Description |
---|---|
AdapterServiceException |
getAdapterServiceException()
This is for internal use only.
|
java.lang.String |
getErrorKey()
Gets the resource bundle key for this exception's error message.
|
java.lang.String[] |
getErrorMessageArgs()
Gets the string arguments required to create a localized error message.
|
com.wm.data.IData |
getIData()
Gets this AdapterException's properties in IData format.
|
java.lang.Exception |
getLinkedException()
Get the associated Exception object that actually caused the error.
|
java.lang.Throwable |
getLinkedThrowable()
Gets the underlying error that caused this exception to be thrown.
|
java.lang.String |
getLocalizedMessage()
Gets the error message regarding this exception in the Integration Server's Locale.
|
java.lang.String |
getLocalizedMessage(java.util.Locale l)
Gets the error message regarding this exception for the specified Locale.
|
java.lang.String |
getMessage()
Gets the error message regarding this exception in the Integration Server's Locale.
|
java.lang.String |
getNodeName()
Gets the name of the Node associated with this error.
|
java.lang.String |
getResourceBundleName()
Gets the base name for the resource bundle containing the error message.
|
static java.lang.String |
getStackTrace(java.lang.Throwable t)
Gets a stack trace from a throwable object.
|
protected void |
init(java.lang.String defaultMessage,
java.lang.String errorCode,
java.lang.String[] errorMessageArgs,
AdapterResourceBundleManager mgr,
java.lang.String resourceBundleName,
com.wm.data.IData detail,
java.lang.Throwable reason,
java.lang.String majorCode)
Internal method to initialize an AdapterException.
|
boolean |
logged()
Gets the flag indicating whether this exception has already been logged
by the ErrorManger routine.
|
void |
setIData(com.wm.data.IData data)
Set this AdapterException's properties based on the contents of the IData.
|
void |
setLinkedException(java.lang.Exception reason)
Associate an Exception object that actually caused the error.
|
void |
setLinkedThrowable(java.lang.Throwable reason)
Associates the throwable object that caused the error.
|
void |
setLogged(boolean logged)
Sets the flag indicating that this exception has already been logged by
the ErrorManger routine.
|
void |
setNodeName(java.lang.String nodeName)
Sets the name of the Node associated with this error.
|
protected AdapterResourceBundleManager _bundleManager
protected com.wm.data.IData _data
protected java.util.Date _date
protected java.lang.String _defaultMessage
protected java.lang.String _errorCode
protected java.lang.String[] _errorMessageArgs
protected java.lang.String _errorResourceBundleName
protected java.lang.String _majorCode
protected java.lang.Throwable _throwable
public AdapterException(AdapterResourceBundleManager mgr, java.lang.String errorCode, java.lang.String[] errorMessageArgs, com.wm.data.IData detail, java.lang.Throwable reason)
errorCode
- The "key" to an error message in a resource bundleerrorMessageArgs
- String arguments needed to form the localized error message stored in the resource bundledetail
- (optional) IData object contain any additional information that should be captured as part of the errorreason
- (optional) The throwable exception that caused the adapter error, if anypublic AdapterException(AdapterResourceBundleManager mgr, java.lang.String majorCode, java.lang.String errorCode, java.lang.String[] errorMessageArgs, com.wm.data.IData detail, java.lang.Throwable reason)
majorCode
- (optional) String representation of the Major or Facility code for this ExceptionerrorCode
- The "key" to an error message in a resource bundleerrorMessageArgs
- String arguments needed to form the localized error message stored in the resource bundledetail
- (optional) IData object contain any additional information that should be captured as part of the errorreason
- (optional) The throwable exception that caused the adapter error, if anypublic AdapterException(AdapterResourceBundleManager mgr, java.lang.String majorCode, java.lang.String errorCode, java.lang.String[] errorMessageArgs, com.wm.data.IData detail, java.lang.Throwable reason, boolean log)
majorCode
- (optional) String representation of the Major or Facility code for this ExceptionerrorCode
- The "key" to an error message in a resource bundleerrorMessageArgs
- String arguments needed to form the localized error message stored in the resource bundledetail
- (optional) IData object contain any additional information that should be captured as part of the errorreason
- (optional) The throwable exception that caused the adapter error, if anylog
- exception to be logged?public AdapterException(int majorCode, int minorCode, java.lang.String[] errorMessageArgs, AdapterResourceBundleManager mgr, com.wm.data.IData detail, java.lang.Throwable t)
majorCode
- The "Major Code" or also known as the "Facitlity Code" of an AdapterminorCode
- The "Minor Code" of an Error messageerrorMessageArgs
- String arguments needed to form the localized error message stored in the resource bundlemgr
- ResourceBundleManager that controls the bundle containing the error messagedetail
- (optional) IData object contain any additional information that should be captured as part of the errorreason
- (optional) The throwable exception that caused the adapter error, if anypublic AdapterException(int majorCode, int minorCode, java.lang.String[] errorMessageArgs, java.lang.String bundleName, com.wm.data.IData detail, java.lang.Throwable t)
majorCode
- The "Major Code" or also known as the "Facitlity Code" of an AdapterminorCode
- The "Minor Code" of an Error messageerrorMessageArgs
- String arguments needed to form the localized error message stored in the resource bundleerrorResourceBundleName
- Name of the ResourceBundle containing the error message with a key of major.minor in the bundledetail
- (optional) IData object contain any additional information that should be captured as part of the errorreason
- (optional) The throwable exception that caused the adapter error, if anypublic AdapterException(java.lang.String message, com.wm.data.IData detail, java.lang.Throwable reason)
message
- Text string describing the error.detail
- any additional details.reason
- If you are throwing one exception because you caught one
and are not handling it, include that exception here. Its stack trace
will be included in the error detail.public AdapterException(java.lang.String defaultMessage, java.lang.String errorCode, java.lang.String[] errorMessageArgs, java.lang.String errorResourceBundleName, com.wm.data.IData detail, java.lang.Throwable reason)
defaultMessage
- An error message that should be displayed
when AdapterException.getMessage() is called. This message is in
a particular locale, preferably the client's locale.errorCode
- The "key" to an error message in a resource bundleerrorMessageArgs
- String arguments needed to form the localized error message stored in the resource bundleerrorResourceBundleName
- The java class name of the resource bundle where the error message is storeddetail
- (optional) IData object contain any additional information that should be captured as part of the errorreason
- (optional) The throwable exception that caused the adapter error, if anypublic AdapterServiceException getAdapterServiceException()
public java.lang.String getErrorKey()
getErrorKey
in interface LocalizableException
public java.lang.String[] getErrorMessageArgs()
getErrorMessageArgs
in interface LocalizableException
public com.wm.data.IData getIData()
getIData
in interface com.wm.util.coder.IDataCodable
public java.lang.Exception getLinkedException()
getLinkedException
in class javax.resource.ResourceException
getLinkedThrowable()
,
setLinkedException(java.lang.Exception)
public java.lang.Throwable getLinkedThrowable()
public java.lang.String getLocalizedMessage()
getLocalizedMessage
in class java.lang.Throwable
public java.lang.String getLocalizedMessage(java.util.Locale l)
getLocalizedMessage
in interface com.wm.util.SpecifiedLocale
public java.lang.String getMessage()
getMessage
in class javax.resource.ResourceException
public java.lang.String getNodeName()
getNodeName
in interface LoggableException
public java.lang.String getResourceBundleName()
getResourceBundleName
in interface LocalizableException
public static java.lang.String getStackTrace(java.lang.Throwable t)
protected void init(java.lang.String defaultMessage, java.lang.String errorCode, java.lang.String[] errorMessageArgs, AdapterResourceBundleManager mgr, java.lang.String resourceBundleName, com.wm.data.IData detail, java.lang.Throwable reason, java.lang.String majorCode)
defaultMessage
- An error message that should be displayed
when AdapterException.getMessage() is called. This message is in
a particular locale, preferably the client's locale.errorCode
- The "key" to an error message in a resource bundleerrorMessageArgs
- String arguments needed to form the localized error message stored in the resource bundleerrorResourceBundleName
- The java class name of the resource bundle where the error message is storeddetail
- (optional) IData object contain any additional information that should be captured as part of the errorreason
- (optional) The throwable exception that caused the adapter error, if anypublic boolean logged()
logged
in interface LoggableException
public void setIData(com.wm.data.IData data)
setIData
in interface com.wm.util.coder.IDataCodable
data
- IData object containing AdapterException propertiespublic void setLinkedException(java.lang.Exception reason)
setLinkedException
in class javax.resource.ResourceException
reason
- The Exception object that is the cause of the errorsetLinkedThrowable(java.lang.Throwable)
,
getLinkedException()
public void setLinkedThrowable(java.lang.Throwable reason)
reason
- the throwable object that is the cause of the errorpublic void setLogged(boolean logged)
setLogged
in interface LoggableException
logged
- set to true once ErrorManage has processed the Exceptionpublic void setNodeName(java.lang.String nodeName)
setNodeName
in interface LoggableException
nodeName
- containing NodeName associated with this error
Copyright © 2003 - 2021 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.