Interface WorkerTask

All Superinterfaces:
Runnable
All Known Subinterfaces:
SchedulerTask
All Known Implementing Classes:
AbstractTransportServerThread, DefaultTcpTransportMapping.ServerThread, DefaultThreadFactory.WorkerThread, DefaultUdpTransportMapping.ListenThread, TLSTM.ServerThread

public interface WorkerTask extends Runnable
This models a WorkerTask instance that would be executed by a WorkerPool upon submission.
Since:
1.9
Version:
3.10.0
Author:
Frank Fock
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Interrupts this task.
    void
    Waits until this task has been finished.
    boolean
    join(long timeout)
    Waits until this task has been finished or the specified timeout has elapsed.
    void
    Gracefully shuts down this task.
    void
    The WorkerPool might call this method to hint the active WorkTask instance to complete execution as soon as possible.

    Methods inherited from interface Runnable

    run
  • Method Details

    • shutdown

      void shutdown()
      Gracefully shuts down this task. All pending operations should be finished, but no new operations should be accepted.
      Since:
      3.10.0
    • terminate

      void terminate()
      The WorkerPool might call this method to hint the active WorkTask instance to complete execution as soon as possible.
    • join

      void join() throws InterruptedException
      Waits until this task has been finished.
      Throws:
      InterruptedException - if the join has been interrupted by another thread.
    • join

      boolean join(long timeout) throws InterruptedException
      Waits until this task has been finished or the specified timeout has elapsed.
      Parameters:
      timeout - the maximum time to wait in milliseconds.
      Returns:
      true if the task has been finished, false otherwise.
      Throws:
      InterruptedException - if the join has been interrupted by another thread.
      Since:
      3.10.0
    • interrupt

      void interrupt()
      Interrupts this task.
      See Also: