org.apache.qpid
Class AMQException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.qpid.AMQException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AMQChannelClosedException, AMQChannelException, AMQConnectionClosedException, AMQConnectionException, AMQConnectionFailureException, AMQDisconnectedException, AMQFrameDecodingException, AMQInternalException, AMQInvalidArgumentException, AMQInvalidRoutingKeyException, AMQProtocolException, AMQProtocolHeaderException, AMQSecurityException, AMQTimeoutException, AMQUndeliveredException, AMQUnknownExchangeType, AMQUnresolvedAddressException, PropertyException

public class AMQException
extends Exception

AMQException forms the root exception of all exceptions relating to the AMQ protocol. It provides space to associate a required AMQ error code with the exception, which is a numeric value, with a meaning defined by the protocol.

CRC Card
Responsibilities Collaborations
Represents an exception condition associated with an AMQ protocol status code.

See Also:
Serialized Form
Todo:
This exception class is also used as a generic exception throughout Qpid code. This usage may not be strictly correct if this is to signify a protocol exception. Should review.

Constructor Summary
AMQException(AMQConstant errorCode, String msg)
          Deprecated. 
AMQException(AMQConstant errorCode, String msg, Throwable cause)
          Creates an exception with an optional error code, optional message and optional underlying cause.
AMQException(String msg)
          Deprecated. 
AMQException(String msg, Throwable cause)
          Deprecated. 
 
Method Summary
 AMQException cloneForCurrentThread()
          Rethrown this exception as a new exception.
 AMQConstant getErrorCode()
          Gets the AMQ protocol exception code associated with this exception.
 boolean isHardError()
           
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMQException

public AMQException(AMQConstant errorCode,
                    String msg,
                    Throwable cause)
Creates an exception with an optional error code, optional message and optional underlying cause.

Parameters:
errorCode - The error code. May be null if not to be set.
msg - The exception message. May be null if not to be set.
cause - The underlying cause of the exception. May be null if not to be set.

AMQException

@Deprecated
public AMQException(String msg)
Deprecated. 


AMQException

@Deprecated
public AMQException(AMQConstant errorCode,
                               String msg)
Deprecated. 


AMQException

@Deprecated
public AMQException(String msg,
                               Throwable cause)
Deprecated. 

Method Detail

toString

public String toString()
Overrides:
toString in class Throwable

getErrorCode

public AMQConstant getErrorCode()
Gets the AMQ protocol exception code associated with this exception.

Returns:
The AMQ protocol exception code associated with this exception.

isHardError

public boolean isHardError()

cloneForCurrentThread

public AMQException cloneForCurrentThread()
Rethrown this exception as a new exception. Attempt to create a new exception of the same class if they have the default constructor of: {AMQConstant.class, String.class, Throwable.class}

Individual subclasses may override as requried to create a new instance.



Licensed to the Apache Software Foundation