public class

ShutdownNotifierComponent

extends Object
implements ShutdownNotifier
java.lang.Object
   ↳ com.rabbitmq.client.impl.ShutdownNotifierComponent
Known Direct Subclasses
Known Indirect Subclasses

Summary

Public Constructors
ShutdownNotifierComponent()
Public Methods
void addShutdownListener(ShutdownListener listener)
Add shutdown listener.
ShutdownSignalException getCloseReason()
Get the shutdown reason object
boolean isOpen()
Determine whether the component is currently open.
void notifyListeners()
Protected API - notify the listeners attached to the component
void removeShutdownListener(ShutdownListener listener)
Remove shutdown listener for the component.
boolean setShutdownCauseIfOpen(ShutdownSignalException sse)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.rabbitmq.client.ShutdownNotifier

Public Constructors

public ShutdownNotifierComponent ()

Public Methods

public void addShutdownListener (ShutdownListener listener)

Add shutdown listener. If the component is already closed, handler is fired immediately

Parameters
listener ShutdownListener to the component

public ShutdownSignalException getCloseReason ()

Get the shutdown reason object

Returns
  • ShutdownSignalException if component is closed, null otherwise

public boolean isOpen ()

Determine whether the component is currently open. Will return false if we are currently closing. Checking this method should be only for information, because of the race conditions - state can change after the call. Instead just execute and try to catch ShutdownSignalException and IOException

Returns
  • true when component is open, false otherwise

public void notifyListeners ()

Protected API - notify the listeners attached to the component

public void removeShutdownListener (ShutdownListener listener)

Remove shutdown listener for the component.

Parameters
listener ShutdownListener to be removed

public boolean setShutdownCauseIfOpen (ShutdownSignalException sse)