javax.resource
Class ResourceException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjavax.resource.ResourceException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ApplicationServerInternalException (src) , CommException (src) , EISSystemException (src) , IllegalStateException (src) , InvalidPropertyException (src) , JBossResourceException (src) , LocalTransactionException (src) , NotSupportedException (src) , ResourceAdapterInternalException (src) , ResourceAllocationException (src) , ResourceWarning (src) , SecurityException (src) , SharingViolationException (src) , UnavailableException (src) , WorkException (src)

public class ResourceException
extends java.lang.Exception

This is the root exception for the exception hierarchy defined for the connector architecture. A ResourceException contains three items, the first two of which are set from the constructor. The first is a standard message string which is accessed via the getMessage() method. The second is an errorCode which is accessed via the getErrorCode() method. The third is a linked exception which provides more information from a lower level in the resource manager. Linked exceptions are accessed via get/setLinkedException.

See Also:
Serialized Form

Constructor Summary
ResourceException()
          Create an exception with a null reason.
ResourceException(java.lang.String reason)
          Create an exception with a reason.
ResourceException(java.lang.String reason, java.lang.String errorCode)
          Create an exception with a reason and an errorCode.
ResourceException(java.lang.String reason, java.lang.Throwable throwable)
          Create an exception with a reason and an errorCode.
ResourceException(java.lang.Throwable throwable)
          Create an exception with a reason and an errorCode.
 
Method Summary
 java.lang.String getErrorCode()
          Get the error code.
 java.lang.Exception getLinkedException()
          Get any linked exception.
 java.lang.String getMessage()
          Get the message composed of the reason and error code.
 void setErrorCode(java.lang.String errorCode)
          Set the error code.
 void setLinkedException(java.lang.Exception linkedException)
          Deprecated. use initCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceException

public ResourceException()
Create an exception with a null reason.


ResourceException

public ResourceException(java.lang.String reason)
Create an exception with a reason.

Parameters:
reason - the reason

ResourceException

public ResourceException(java.lang.String reason,
                         java.lang.String errorCode)
Create an exception with a reason and an errorCode.

Parameters:
reason - the reason
errorCode - the error code

ResourceException

public ResourceException(java.lang.String reason,
                         java.lang.Throwable throwable)
Create an exception with a reason and an errorCode.

Parameters:
reason - the reason
throwable - the linked error

ResourceException

public ResourceException(java.lang.Throwable throwable)
Create an exception with a reason and an errorCode.

Parameters:
throwable - the linked error
Method Detail

getErrorCode

public java.lang.String getErrorCode()
Get the error code.

Returns:
the error code

getLinkedException

public java.lang.Exception getLinkedException()
Get any linked exception.

Returns:
the linked exception

getMessage

public java.lang.String getMessage()
Get the message composed of the reason and error code.

Returns:
message composed of the reason and error code.

setErrorCode

public void setErrorCode(java.lang.String errorCode)
Set the error code.

Parameters:
errorCode - code the error code

setLinkedException

public void setLinkedException(java.lang.Exception linkedException)
Deprecated. use initCause

Set a linked exception.

Parameters:
linkedException - the linked exception