- 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 theCompletableFuturereturned 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 protectedShutdown(java.lang.Object component)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcancel()voidcheck()This method should be called whenever the components state has been updated.booleanisShutdown()abstract booleanisShutdownDone()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:GracefulShutdown the component. When this method returns, the component should not accept any new load.
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin 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 theFuturereturned byshutdown()is completed.
-
cancel
public void cancel()
-
isShutdownDone
public abstract boolean isShutdownDone()
- Returns:
- True if the component is shutdown and has no remaining load.
-
-