Package org.eclipse.jetty.util.component
Class Graceful.Shutdown
- java.lang.Object
-
- org.eclipse.jetty.util.component.Graceful.Shutdown
-
- All Implemented Interfaces:
Graceful
- Enclosing interface:
- Graceful
public abstract static class Graceful.Shutdown extends java.lang.Object implements Graceful
A utility class to assist implementing the Graceful interface. TheisShutdownDone()
method should be implemented to check if theCompletableFuture
returned byshutdown()
should be completed or not. Thecheck()
method should be called when any state is changed which may complete the shutdown.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful
Graceful.Shutdown, Graceful.ThrowingRunnable
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Shutdown(java.lang.Object component)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cancel()
void
check()
This method should be called whenever the components state has been updated.boolean
isShutdown()
abstract boolean
isShutdownDone()
java.util.concurrent.CompletableFuture<java.lang.Void>
shutdown()
Shutdown the component.
-
-
-
Method Detail
-
shutdown
public java.util.concurrent.CompletableFuture<java.lang.Void> shutdown()
Description copied from interface:Graceful
Shutdown the component. When this method returns, the component should not accept any new load.
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfaceGraceful
- Returns:
- True if
Graceful.shutdown()
has been called.
-
check
public void check()
This method should be called whenever the components state has been updated. Ifshutdown()
has been called, thenisShutdownDone()
is called by this method and if it returns true then theFuture
returned byshutdown()
is completed.
-
cancel
public void cancel()
-
isShutdownDone
public abstract boolean isShutdownDone()
- Returns:
- True if the component is shutdown and has no remaining load.
-
-