public class ShutdownNotifierComponent extends Object implements ShutdownNotifier
ShutdownListener
s and remembers the reason for a shutdown. Both
Channel
s and Connection
s have shutdown listeners.Constructor and Description |
---|
ShutdownNotifierComponent() |
Modifier and Type | Method and Description |
---|---|
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)
Internal: this is the means of registering shutdown.
|
public void addShutdownListener(ShutdownListener listener)
ShutdownNotifier
addShutdownListener
in interface ShutdownNotifier
listener
- ShutdownListener
to the componentpublic ShutdownSignalException getCloseReason()
ShutdownNotifier
getCloseReason
in interface ShutdownNotifier
public void notifyListeners()
ShutdownNotifier
notifyListeners
in interface ShutdownNotifier
ShutdownListener
public void removeShutdownListener(ShutdownListener listener)
ShutdownNotifier
removeShutdownListener
in interface ShutdownNotifier
listener
- ShutdownListener
to be removedpublic boolean isOpen()
ShutdownNotifier
isOpen
in interface ShutdownNotifier
public boolean setShutdownCauseIfOpen(ShutdownSignalException sse)
sse
- the reason for the shutdowntrue
if the component is open; false
otherwise.Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.