Package com.rabbitmq.client
Class ShutdownSignalException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.rabbitmq.client.ShutdownSignalException
- All Implemented Interfaces:
SensibleClone<ShutdownSignalException>
,Serializable
,Cloneable
- Direct Known Subclasses:
AlreadyClosedException
public class ShutdownSignalException
extends RuntimeException
implements SensibleClone<ShutdownSignalException>
Encapsulates a shutdown condition for a connection to an AMQP broker.
Depending on HardError when calling
getReference()
we will
either get a reference to the Connection or Channel instance that fired
this exception.- See Also:
-
Constructor Summary
ConstructorDescriptionShutdownSignalException
(boolean hardError, boolean initiatedByApplication, Method reason, Object ref) Construct a ShutdownSignalException from the arguments.ShutdownSignalException
(boolean hardError, boolean initiatedByApplication, Method reason, Object ref, String messagePrefix, Throwable cause) Construct a ShutdownSignalException from the arguments. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Like Object.clone but sensible; in particular, public and declared to return the right type.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ShutdownSignalException
public ShutdownSignalException(boolean hardError, boolean initiatedByApplication, Method reason, Object ref) Construct a ShutdownSignalException from the arguments.- Parameters:
hardError
- the relevant hard errorinitiatedByApplication
- if the shutdown was client-initiatedreason
- AMQP method describing the exception reasonref
- Reference to Connection or Channel that fired the signal
-
ShutdownSignalException
public ShutdownSignalException(boolean hardError, boolean initiatedByApplication, Method reason, Object ref, String messagePrefix, Throwable cause) Construct a ShutdownSignalException from the arguments.- Parameters:
hardError
- the relevant hard errorinitiatedByApplication
- if the shutdown was client-initiatedreason
- AMQP method describing the exception reasonref
- Reference to Connection or Channel that fired the signalmessagePrefix
- prefix to add to exception message
-
-
Method Details
-
isHardError
public boolean isHardError()- Returns:
- true if this signals a connection error, or false if a channel error
-
isInitiatedByApplication
public boolean isInitiatedByApplication()- Returns:
- true if this exception was caused by explicit application action; false if it originated with the broker or as a result of detectable non-deliberate application failure
-
getReason
- Returns:
- the reason, if any
-
getReference
- Returns:
- Reference to Connection or Channel object that fired the signal
-
sensibleClone
Description copied from interface:SensibleClone
Like Object.clone but sensible; in particular, public and declared to return the right type.- Specified by:
sensibleClone
in interfaceSensibleClone<ShutdownSignalException>
-