Jetty components that wish to be part of a Graceful shutdown implement this interface so that
the Graceful#shutdown() method will be called to initiate a shutdown. Shutdown operations
can fall into the following categories:
The CompletableFuture returned by the the shutdown call will be completed to indicate the
shutdown operation is completed.
Some shutdown operations may be instantaneous and always return a completed future.
Graceful shutdown is typically orchestrated by the doStop methods of Server or ContextHandler (for a full or partial shutdown respectively).
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | Graceful.
A utility class to assist implementing the Graceful interface. |
| public static interface |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public CompletableFuture | Returns: A future that is completed once all load on the component is completedShutdown the component. |
| public static CompletableFuture | Returns: ACompletableFuture that is complete once all returns from Graceful#shutdown()
of the contained Gracefuls are complete.The container in which to look for component)GracefulsUtility method to shutdown all Gracefuls within a container. |
| public static CompletableFuture | Returns: the CompletableFuture to be notified when the runnable either completes or fails.the ThrowingRunnable to run. runnableUtility method to execute a |
| isShutdown | back to summary |
|---|---|
public boolean isShutdown()
| |
| shutdown | back to summary |
|---|---|
| public CompletableFuture Shutdown the component. When this method returns, the component should not accept any new load.
| |
| shutdown | back to summary |
|---|---|
| public static CompletableFuture Utility method to shutdown all Gracefuls within a container.
| |
| shutdown | back to summary |
|---|---|
| public static CompletableFuture Utility method to execute a
| |
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.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Object | |
| pack-priv final AtomicReference |
| Modifier and Type | Method and Description |
|---|---|
| public void | cancel()
This method can be called after |
| public void | |
| public boolean | |
| public abstract boolean | |
| public CompletableFuture |
| _component | back to summary |
|---|---|
| pack-priv final Object _component | |
| _done | back to summary |
|---|---|
| pack-priv final AtomicReference<CompletableFuture<Void>> _done | |
| Shutdown | back to summary |
|---|---|
| protected Shutdown(Object component) | |
| cancel | back to summary |
|---|---|
| public void cancel() This method can be called after | |
| check | back to summary |
|---|---|
| public void check() This method should be called whenever the components state has been updated.
If | |
| isShutdown | back to summary |
|---|---|
| public boolean isShutdown() Implements org.
| |
| isShutdownDone | back to summary |
|---|---|
public abstract boolean isShutdownDone()
| |
| shutdown | back to summary |
|---|---|
| public CompletableFuture Implements org. Doc from org. Shutdown the component. When this method returns, the component should not accept any new load.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| run | back to summary |
|---|---|
| public void run() throws Exception | |