public interface

ShutdownNotifier

com.rabbitmq.client.ShutdownNotifier
Known Indirect Subclasses

Class Overview

Interface for components that are shutdown capable and that allow listeners to be added for shutdown signals

Summary

Public Methods
abstract void addShutdownListener(ShutdownListener listener)
Add shutdown listener.
abstract ShutdownSignalException getCloseReason()
Get the shutdown reason object
abstract boolean isOpen()
Determine whether the component is currently open.
abstract void notifyListeners()
Protected API - notify the listeners attached to the component
abstract void removeShutdownListener(ShutdownListener listener)
Remove shutdown listener for the component.

Public Methods

public abstract void addShutdownListener (ShutdownListener listener)

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

Parameters
listener ShutdownListener to the component

public abstract ShutdownSignalException getCloseReason ()

Get the shutdown reason object

Returns
  • ShutdownSignalException if component is closed, null otherwise

public abstract 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 abstract void notifyListeners ()

Protected API - notify the listeners attached to the component

See Also

public abstract void removeShutdownListener (ShutdownListener listener)

Remove shutdown listener for the component.

Parameters
listener ShutdownListener to be removed