com.h3c.util.concurrent

## Interface ThreadExecutor

- All Superinterfaces:
    CallableExecutor, RunnableExecutor
  All Known Subinterfaces:
    TaskExecutorService
  All Known Implementing Classes:
    DefaultThreadExecutor, ThreadMonitor

      public interface ThreadExecutor
      extends CallableExecutor, RunnableExecutor

  Thread executor.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> ScheduledFuture<T>` | `schedule(Callable<T> task, javax.measure.Measurable<javax.measure.quantity.Duration> delay)` Creates and executes a ScheduledFuture that becomes enabled after the given delay.
    `ScheduledFuture<?>` | `schedule(Runnable task, javax.measure.Measurable<javax.measure.quantity.Duration> delay)` Creates and executes a ScheduledFuture that becomes enabled after the given delay.
    `ScheduledFuture<?>` | `scheduleAtFixedRate(Runnable task, Date initialTime, javax.measure.Measurable<javax.measure.quantity.Duration> period)` For the sake of cancellability but not provide a usable result Creates and executes a periodic action that becomes enabled first at the given initial time, and subsequently with the given period; that is executions will commence at initialTime then initialTime+period, then initialTime + 2 * period, and so on.
    `ScheduledFuture<?>` | `scheduleAtFixedRate(Runnable task, javax.measure.Measurable<javax.measure.quantity.Duration> initialDelay, javax.measure.Measurable<javax.measure.quantity.Duration> period)` Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on.
    `ScheduledFuture<?>` | `scheduleWithFixedDelay(Runnable task, javax.measure.Measurable<javax.measure.quantity.Duration> initialDelay, javax.measure.Measurable<javax.measure.quantity.Duration> delay)` Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next.

    - ### Methods inherited from interface com.h3c.util.concurrent.CallableExecutor

      `submit`

    - ### Methods inherited from interface com.h3c.util.concurrent.RunnableExecutor

      `submit`

- - ### Method Detail

    - #### schedule

          <T> ScheduledFuture<T> schedule(Callable<T> task,
                                        javax.measure.Measurable<javax.measure.quantity.Duration> delay)

      Creates and executes a ScheduledFuture that becomes enabled after the given delay.
      Type Parameters:
        `T` - the type of the execution result
      Parameters:
        `task` - the task to be executed
        `delay` - the time from now to delay execution
      Returns:
        a future that can be used to extract result or cancel

    - #### schedule

          ScheduledFuture<?> schedule(Runnable task,
                                    javax.measure.Measurable<javax.measure.quantity.Duration> delay)

      Creates and executes a ScheduledFuture that becomes enabled after the given delay.
      Parameters:
        `task` - the runnable task to be executed
        `delay` - the time from now to delay execution
      Returns:
        a future that can be used to cancel

    - #### scheduleAtFixedRate

          ScheduledFuture<?> scheduleAtFixedRate(Runnable task,
                                               javax.measure.Measurable<javax.measure.quantity.Duration> initialDelay,
                                               javax.measure.Measurable<javax.measure.quantity.Duration> period)

      Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on.
      Parameters:
        `task` - the task to be executed
        `initialDelay` - the time to delay first execution
        `period` - the period between successive executions
      Returns:
        a future representing pending completion of the task, and whose get() method will throw an exception upon cancellation

    - #### scheduleAtFixedRate

          ScheduledFuture<?> scheduleAtFixedRate(Runnable task,
                                               Date initialTime,
                                               javax.measure.Measurable<javax.measure.quantity.Duration> period)
                                                 throws IllegalArgumentException

      For the sake of cancellability but not provide a usable result Creates and executes a periodic action that becomes enabled first at the given initial time, and subsequently with the given period; that is executions will commence at initialTime then initialTime+period, then initialTime + 2 * period, and so on.
      Parameters:
        `task` - the task to be executed
        `initialTime` - the time of the first execution
        `period` - the period between successive executions
      Returns:
        a future representing pending completion of the task, and whose get() method will throw an exception upon cancellation
      Throws:
        `IllegalArgumentException` - if initialTime is in the past

    - #### scheduleWithFixedDelay

          ScheduledFuture<?> scheduleWithFixedDelay(Runnable task,
                                                  javax.measure.Measurable<javax.measure.quantity.Duration> initialDelay,
                                                  javax.measure.Measurable<javax.measure.quantity.Duration> delay)

      Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next.
      Parameters:
        `task` - the task to be executed
        `initialDelay` - the time to delay first execution.
        `delay` - the delay between the termination of one execution and the commencement of the next
      Returns:
        a future representing pending completion of the task, and whose get() method will throw an exception upon cancellation

Copyright © 2014. All Rights Reserved.