Class JerseyRequestTimeoutHandler

    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
      • timeoutTask

        private java.util.concurrent.ScheduledFuture<?> timeoutTask
      • suspended

        private boolean suspended
      • runtimeLock

        private final java.lang.Object runtimeLock
      • executor

        private final java.util.concurrent.ScheduledExecutorService executor
    • Constructor Detail

      • JerseyRequestTimeoutHandler

        public JerseyRequestTimeoutHandler​(ContainerResponseWriter containerResponseWriter,
                                           java.util.concurrent.ScheduledExecutorService timeoutTaskExecutor)
        Create request timeout handler for the giver response writer.
        Parameters:
        containerResponseWriter - response writer to create request timeout handler for.
        timeoutTaskExecutor - Jersey runtime executor used for background execution of timeout handling tasks.
    • Method Detail

      • setSuspendTimeout

        public void setSuspendTimeout​(long timeOut,
                                      java.util.concurrent.TimeUnit unit)
                               throws java.lang.IllegalStateException
        Set the suspend timeout.
        Parameters:
        timeOut - time-out value. Value less or equal to 0, indicates that the processing is suspended indefinitely.
        unit - time-out time unit.
        Throws:
        java.lang.IllegalStateException - in case the response writer has not been suspended yet.
        See Also:
        ContainerResponseWriter.setSuspendTimeout(long, TimeUnit)
      • close

        public void close()
        Cancel the suspended task.
      • close

        private void close​(boolean interruptIfRunning)