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
A utility class to assist implementing the Graceful interface.
The
isShutdownDone()
method should be implemented to check if the CompletableFuture
returned by shutdown()
should be completed or not. The check()
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
This method can be called aftershutdown()
has been called, but beforecheck()
has been called withisShutdownDone()
having returned true to cancel the effects of theshutdown()
call.void
check()
This method should be called whenever the components state has been updated.boolean
abstract boolean
shutdown()
Shutdown the component.
-
Constructor Details
-
Shutdown
-
-
Method Details
-
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()This method can be called aftershutdown()
has been called, but beforecheck()
has been called withisShutdownDone()
having returned true to cancel the effects of theshutdown()
call. -
isShutdownDone
public abstract boolean isShutdownDone()- Returns:
- True if the component is shutdown and has no remaining load.
-