Package org.jboss.resteasy.concurrent

## Class ContextualScheduledExecutorService

- java.lang.Object
- - org.jboss.resteasy.concurrent.ContextualExecutorService
  - - org.jboss.resteasy.concurrent.ContextualScheduledExecutorService

- All Implemented Interfaces:
    `Executor`, `ExecutorService`, `ScheduledExecutorService`

      public class ContextualScheduledExecutorService
      extends ContextualExecutorService
      implements ScheduledExecutorService

  An executor which wraps runnables and callables to capture the context of the current thread.

  If a server is managed it's the responsibility of the user or container to manage the lifecycle of the wrapped executor service.

  Note: if the executor is consider managed, for example running in a Jakarta EE environment, the following methods are effectively ignored.

  - `ContextualExecutorService.shutdown()`
  - `ContextualExecutorService.shutdownNow()`
  - `ContextualExecutorService.isShutdown()`
  - `ContextualExecutorService.isTerminated()`
  - `ContextualExecutorService.awaitTermination(long, TimeUnit)`
  Since:
    5.0.0
  Author:
    James R. Perkins

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ScheduledFuture<?>` | `schedule​(Runnable command, long delay, TimeUnit unit)` |
    `<V> ScheduledFuture<V>` | `schedule​(Callable<V> callable, long delay, TimeUnit unit)` |
    `ScheduledFuture<?>` | `scheduleAtFixedRate​(Runnable command, long initialDelay, long period, TimeUnit unit)` |
    `ScheduledFuture<?>` | `scheduleWithFixedDelay​(Runnable command, long initialDelay, long delay, TimeUnit unit)` |

    - ### Methods inherited from class org.jboss.resteasy.concurrent.ContextualExecutorService

      `awaitTermination, execute, invokeAll, invokeAll, invokeAny, invokeAny, isManaged, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.concurrent.Executor

      `execute`

    - ### Methods inherited from interface java.util.concurrent.ExecutorService

      `awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit`

- - ### Method Detail

    - #### schedule

          public ScheduledFuture<?> schedule​(Runnable command,
                                             long delay,
                                             TimeUnit unit)

      Specified by:
        `schedule` in interface `ScheduledExecutorService`

    - #### schedule

          public <V> ScheduledFuture<V> schedule​(Callable<V> callable,
                                                 long delay,
                                                 TimeUnit unit)

      Specified by:
        `schedule` in interface `ScheduledExecutorService`

    - #### scheduleAtFixedRate

          public ScheduledFuture<?> scheduleAtFixedRate​(Runnable command,
                                                        long initialDelay,
                                                        long period,
                                                        TimeUnit unit)

      Specified by:
        `scheduleAtFixedRate` in interface `ScheduledExecutorService`

    - #### scheduleWithFixedDelay

          public ScheduledFuture<?> scheduleWithFixedDelay​(Runnable command,
                                                           long initialDelay,
                                                           long delay,
                                                           TimeUnit unit)

      Specified by:
        `scheduleWithFixedDelay` in interface `ScheduledExecutorService`