Class ExecutorManager<O extends ExecutorRunnable>

java.lang.Object
java.lang.Thread
ecmwf.common.technical.ExecutorManager<O>
Type Parameters:
O - the generic type
All Implemented Interfaces:
Runnable

public final class ExecutorManager<O extends ExecutorRunnable> extends Thread
The Class ExecutorManager.
  • Constructor Details Link icon

    • ExecutorManager Link icon

      public ExecutorManager(int maxWaiting, int maxRunning)
      Instantiates a new executor manager.
      Parameters:
      maxWaiting - the max waiting
      maxRunning - the max running
    • ExecutorManager Link icon

      public ExecutorManager(int maxWaiting, int maxRunning, boolean start)
      Instantiates a new executor manager.
      Parameters:
      maxWaiting - the max waiting
      maxRunning - the max running
      start - the start
  • Method Details Link icon

    • getThreadCount Link icon

      public AtomicInteger getThreadCount()
      Gets the thread count.
      Returns:
      the thread count
    • getCount Link icon

      public int getCount()
      Gets the count.
      Returns:
      the count
    • put Link icon

      public void put(O entry) throws InterruptedException
      Add a new Thread to the list. Inserts the Thread at the tail of this queue, waiting for space to become available if the queue is full.
      Parameters:
      entry - the entry
      Throws:
      InterruptedException - the interrupted exception
    • offer Link icon

      public boolean offer(O entry)
      Inserts the Thread at the tail of this queue if it is possible to do so immediately without exceeding the queue's capacity, return false if this queue is full. If the Thread already exists in the queue then return true and do nothing.
      Parameters:
      entry - the entry
      Returns:
      true, if successful
    • startIfNotStarted Link icon

      public void startIfNotStarted()
      Start the Thread if it is not yet started.
    • stopRun Link icon

      public void stopRun()
      Ends the loop.
    • run Link icon

      public void run()
      Run.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • stopAndJoin Link icon

      public void stopAndJoin() throws InterruptedException
      Stop and join.
      Throws:
      InterruptedException - the interrupted exception