public static class Graceful.Shutdown extends java.lang.Object implements Graceful
FutureCallback
to indicate if shutdown is completed.
By default the FutureCallback
is returned as already completed, but the newShutdownCallback()
method
can be overloaded to return a non-completed callback that will require a Callback.succeeded()
or
Callback.failed(Throwable)
call to be completed.Graceful.Shutdown
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicReference<FutureCallback> |
_shutdown |
Constructor and Description |
---|
Shutdown() |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
FutureCallback |
get() |
boolean |
isShutdown() |
protected FutureCallback |
newShutdownCallback() |
java.util.concurrent.Future<java.lang.Void> |
shutdown() |
private final java.util.concurrent.atomic.AtomicReference<FutureCallback> _shutdown
protected FutureCallback newShutdownCallback()
public java.util.concurrent.Future<java.lang.Void> shutdown()
public boolean isShutdown()
isShutdown
in interface Graceful
public void cancel()
public FutureCallback get()