The handler itself does not shut anything down.
Import: The thread safety semantics of the handler are very important. Don't touch anything unless you know what you are doing.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| public static interface | GracefulShutdownHandler.
A listener which can be registered with the handler to be notified when all pending requests have finished. |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private static final LongUnaryOperator | |
| private static final LongUnaryOperator | |
| private static final LongUnaryOperator | |
| private final GracefulShutdownHandler. | |
| private final Object | |
| private final HttpHandler | |
| private static final long | |
| private final List | |
| private volatile long | |
| private static final AtomicLongFieldUpdater |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static long | |
| public void | addShutdownListener(final GracefulShutdownHandler.
The shutdown listener shutdownListenerAdds a shutdown listener that will be invoked when all requests have finished. |
| public void | |
| public boolean | Returns: true If the handler successfully shut downThe length of time millis)Waits a set length of time for the handler to shut down |
| private void | |
| public void | handleRequest(HttpServerExchange
the HTTP request/response exchange exchange)Implements io. Handle the request. |
| private static boolean | |
| public void | |
| private void | |
| public void |
| ACTIVE_COUNT_MASK | back to summary |
|---|---|
| private static final long ACTIVE_COUNT_MASK | |
| decrementActive | back to summary |
|---|---|
| private static final LongUnaryOperator decrementActive | |
| incrementActive | back to summary |
|---|---|
| private static final LongUnaryOperator incrementActive | |
| incrementActiveAndShutdown | back to summary |
|---|---|
| private static final LongUnaryOperator incrementActiveAndShutdown | |
| listener | back to summary |
|---|---|
| private final GracefulShutdownHandler. | |
| lock | back to summary |
|---|---|
| private final Object lock | |
| next | back to summary |
|---|---|
| private final HttpHandler next | |
| SHUTDOWN_MASK | back to summary |
|---|---|
| private static final long SHUTDOWN_MASK | |
| shutdownListeners | back to summary |
|---|---|
| private final List<GracefulShutdownHandler. | |
| state | back to summary |
|---|---|
| private volatile long state | |
| stateUpdater | back to summary |
|---|---|
| private static final AtomicLongFieldUpdater<GracefulShutdownHandler> stateUpdater | |
| GracefulShutdownHandler | back to summary |
|---|---|
| public GracefulShutdownHandler(HttpHandler next) | |
| activeCount | back to summary |
|---|---|
| private static long activeCount(long state) | |
| addShutdownListener | back to summary |
|---|---|
| public void addShutdownListener(final GracefulShutdownHandler. Adds a shutdown listener that will be invoked when all requests have finished. If all requests have already been finished the listener will be invoked immediately.
| |
| awaitShutdown | back to summary |
|---|---|
| public void awaitShutdown() throws InterruptedException Waits for the handler to shutdown. | |
| awaitShutdown | back to summary |
|---|---|
| public boolean awaitShutdown(long millis) throws InterruptedException Waits a set length of time for the handler to shut down
| |
| decrementRequests | back to summary |
|---|---|
| private void decrementRequests() | |
| handleRequest | back to summary |
|---|---|
| public void handleRequest(HttpServerExchange exchange) throws Exception Implements io. Doc from io. Handle the request.
| |
| isShutdown | back to summary |
|---|---|
| private static boolean isShutdown(long state) | |
| shutdown | back to summary |
|---|---|
| public void shutdown() | |
| shutdownComplete | back to summary |
|---|---|
| private void shutdownComplete() | |
| start | back to summary |
|---|---|
| public void start() | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | exchangeEvent(HttpServerExchange exchange, ExchangeCompletionListener.
Implements io.
|
| GracefulShutdownListener | back to summary |
|---|---|
| private GracefulShutdownListener() | |
| exchangeEvent | back to summary |
|---|---|
| public void exchangeEvent(HttpServerExchange exchange, ExchangeCompletionListener. Implements io.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | shutdown(boolean
If the shutdown succeeded or not shutdownSuccessful)Notification that the container has shutdown. |
| shutdown | back to summary |
|---|---|
| public void shutdown(boolean shutdownSuccessful) Notification that the container has shutdown.
| |