com.eurotech.framework
Class EsfException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.eurotech.framework.EsfException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EsfConnectException, EsfNotConnectedException, EsfPartialSuccessException, EsfStoreException, EsfTimeoutException, EsfTooManyInflightMessagesException

public class EsfException
extends Exception

The EsfException class is the superclass of all errors and exceptions in the ESF project. It extends the JDK Exception class by requesting its invokers to provide an error code when building its instances. The code is one value of EsfErrorCode enum; the code is used to document the possible error conditions generated by the platform as well as to identify the localized exception messages to be reported. Exceptions messages are stored in the EsfExceptionMessagesBundle Properties Bundle and they are keyed on the exception code.

See Also:
Serialized Form

Field Summary
protected  EsfErrorCode m_code
           
 
Constructor Summary
EsfException(EsfErrorCode code)
          Builds a new EdcException instance based on the supplied EdcErrorCode.
EsfException(EsfErrorCode code, Object... arguments)
          Builds a new EdcException instance based on the supplied EdcErrorCode.
EsfException(EsfErrorCode code, Throwable cause, Object... arguments)
          Builds a new EdcException instance based on the supplied EdcErrorCode, an optional Throwable cause, and optional arguments for the associated exception message.
 
Method Summary
 EsfErrorCode getCode()
           
 String getLocalizedMessage()
           
 String getMessage()
           
static EsfException internalError(String message)
          Factory method to build an EdcException with the EdcErrorCode.INTERNAL_ERROR code providing only a message.
static EsfException internalError(Throwable cause)
          Factory method to build an EdcException with the EdcErrorCode.INTERNAL_ERROR code providing a cause and a message.
static EsfException internalError(Throwable cause, String message)
          Factory method to build an EdcException with the EdcErrorCode.INTERNAL_ERROR code providing a cause and a message.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_code

protected EsfErrorCode m_code
Constructor Detail

EsfException

public EsfException(EsfErrorCode code)
Builds a new EdcException instance based on the supplied EdcErrorCode.

Parameters:
code -
t -
arguments -

EsfException

public EsfException(EsfErrorCode code,
                    Object... arguments)
Builds a new EdcException instance based on the supplied EdcErrorCode.

Parameters:
code -
t -
arguments -

EsfException

public EsfException(EsfErrorCode code,
                    Throwable cause,
                    Object... arguments)
Builds a new EdcException instance based on the supplied EdcErrorCode, an optional Throwable cause, and optional arguments for the associated exception message.

Parameters:
code -
t -
arguments -
Method Detail

internalError

public static EsfException internalError(Throwable cause,
                                         String message)
Factory method to build an EdcException with the EdcErrorCode.INTERNAL_ERROR code providing a cause and a message.

Parameters:
cause -
message -
Returns:

internalError

public static EsfException internalError(Throwable cause)
Factory method to build an EdcException with the EdcErrorCode.INTERNAL_ERROR code providing a cause and a message.

Parameters:
cause -
message -
Returns:

internalError

public static EsfException internalError(String message)
Factory method to build an EdcException with the EdcErrorCode.INTERNAL_ERROR code providing only a message.

Parameters:
cause -
message -
Returns:

getCode

public EsfErrorCode getCode()

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

getLocalizedMessage

public String getLocalizedMessage()
Overrides:
getLocalizedMessage in class Throwable


Copyright © 2013. All Rights Reserved.