Class 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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Default for non-checking.
      See Also:
    • _hardError

      private final boolean _hardError
      True if the connection is shut down, or false if this signal refers to a channel
    • _initiatedByApplication

      private final boolean _initiatedByApplication
      True if this exception is caused by explicit application action; false if it originated with the broker or as a result of detectable non-deliberate application failure
    • _reason

      private final Method _reason
      Possible explanation
    • _ref

      private final Object _ref
      Either Channel or Connection instance, depending on _hardError
  • Constructor Details

    • ShutdownSignalException

      public ShutdownSignalException(boolean hardError, boolean initiatedByApplication, Method reason, Object ref)
      Construct a ShutdownSignalException from the arguments.
      Parameters:
      hardError - the relevant hard error
      initiatedByApplication - if the shutdown was client-initiated
      reason - AMQP method describing the exception reason
      ref - 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 error
      initiatedByApplication - if the shutdown was client-initiated
      reason - AMQP method describing the exception reason
      ref - Reference to Connection or Channel that fired the signal
      messagePrefix - prefix to add to exception message
  • Method Details

    • composeMessage

      private static String composeMessage(boolean hardError, boolean initiatedByApplication, Method reason, String messagePrefix, Throwable cause)
    • 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

      public Method getReason()
      Returns:
      the reason, if any
    • getReference

      public Object getReference()
      Returns:
      Reference to Connection or Channel object that fired the signal
    • sensibleClone

      public ShutdownSignalException 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 interface SensibleClone<ShutdownSignalException>