com.hammurapi.common.concurrent

## Class LocalTrackingExecutorService

- java.lang.Object
- - java.util.concurrent.AbstractExecutorService
  - - com.hammurapi.common.concurrent.LocalTrackingExecutorService

- All Implemented Interfaces:
    AsynchronousProcessor, TrackingExecutorService, Executor, ExecutorService

      public class LocalTrackingExecutorService
      extends AbstractExecutorService
      implements TrackingExecutorService

  In-JMV tracking executor service.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalTrackingExecutorService(ExecutorService master, boolean oneOff, String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `awaitTermination(long timeout, TimeUnit unit)`
    `void` | `execute(Runnable command)`
    `boolean` | `isShutdown()`
    `boolean` | `isTerminated()`
    `void` | `join()` Executes and removes pending tasks, exits when all tasks are completed.
    `boolean` | `join(long timeout)` Waits for the processor to finish work for specified time.
    `protected <T> RunnableFuture<T>` | `newTaskFor(Callable<T> callable)`
    `protected <T> RunnableFuture<T>` | `newTaskFor(Runnable runnable, T value)`
    `void` | `shutdown()`
    `List<Runnable>` | `shutdownNow()`

    - ### Methods inherited from class java.util.concurrent.AbstractExecutorService

      `invokeAll, invokeAll, invokeAny, invokeAny, 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.ExecutorService

      `invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit`

- - ### Constructor Detail

    - #### LocalTrackingExecutorService

          public LocalTrackingExecutorService(ExecutorService master,
                                      boolean oneOff,
                                      String name)

      Parameters:
        `master` - Master executor.
        `oneOff` - If true, join can be invoked only once. No tasks can be submitted to the executor once join() returns.

  - ### Method Detail

    - #### shutdown

          public void shutdown()

      Specified by:
        `shutdown` in interface `ExecutorService`

    - #### shutdownNow

          public List<Runnable> shutdownNow()

      Specified by:
        `shutdownNow` in interface `ExecutorService`

    - #### isShutdown

          public boolean isShutdown()

      Specified by:
        `isShutdown` in interface `ExecutorService`

    - #### isTerminated

          public boolean isTerminated()

      Specified by:
        `isTerminated` in interface `ExecutorService`

    - #### awaitTermination

          public boolean awaitTermination(long timeout,
                                 TimeUnit unit)
                                   throws InterruptedException

      Specified by:
        `awaitTermination` in interface `ExecutorService`
      Throws:
        `InterruptedException`

    - #### execute

          public void execute(Runnable command)

      Specified by:
        `execute` in interface `Executor`

    - #### newTaskFor

          protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable)

      Overrides:
        `newTaskFor` in class `AbstractExecutorService`

    - #### newTaskFor

          protected <T> RunnableFuture<T> newTaskFor(Runnable runnable,
                                         T value)

      Overrides:
        `newTaskFor` in class `AbstractExecutorService`

    - #### join

          public void join()
                    throws InterruptedException

      Executes and removes pending tasks, exits when all tasks are completed.
      Specified by:
        `join` in interface `AsynchronousProcessor`
      Throws:
        `InterruptedException`

    - #### join

          public boolean join(long timeout)
                       throws InterruptedException

      Description copied from interface: `AsynchronousProcessor`
      Waits for the processor to finish work for specified time.
      Specified by:
        `join` in interface `AsynchronousProcessor`
      Returns:
        true if all work was finished.
      Throws:
        `InterruptedException`