org.csstudio.java.thread
Class ExecutionService

java.lang.Object
  extended by org.csstudio.java.thread.ExecutionService

public class ExecutionService
extends java.lang.Object

Service for the execution of asynchronous tasks using thread pools.

Author:
swende, Xihui Chen (move this from platform to here)

Method Summary
 void executeWithHighPriority(java.lang.Runnable runnable)
          Executes the specified runnable with high priority.
 void executeWithLowPriority(java.lang.Runnable runnable)
          Executes the specified runnable with normal priority.
 void executeWithNormalPriority(java.lang.Runnable runnable)
          Executes the specified runnable with normal priority.
 int getHighPriorityQueueSize()
          Returns the number of runnables waiting for execution with high priority.
static ExecutionService getInstance()
          Returns the singleton instance.
 int getLowPriorityQueueSize()
          Returns the number of runnables waiting for execution with low priority.
 int getNormalPriorityQueueSize()
          Returns the number of runnables waiting for execution with normal priority.
 java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ExecutionService getInstance()
Returns the singleton instance.

Returns:
the singleton instance

executeWithHighPriority

public void executeWithHighPriority(java.lang.Runnable runnable)
Executes the specified runnable with high priority.

Parameters:
runnable - the runnable

executeWithNormalPriority

public void executeWithNormalPriority(java.lang.Runnable runnable)
Executes the specified runnable with normal priority.

Parameters:
runnable - the runnable

getHighPriorityQueueSize

public int getHighPriorityQueueSize()
Returns the number of runnables waiting for execution with high priority.


getNormalPriorityQueueSize

public int getNormalPriorityQueueSize()
Returns the number of runnables waiting for execution with normal priority.


getLowPriorityQueueSize

public int getLowPriorityQueueSize()
Returns the number of runnables waiting for execution with low priority.


executeWithLowPriority

public void executeWithLowPriority(java.lang.Runnable runnable)
Executes the specified runnable with normal priority.

Parameters:
runnable - the runnable

getScheduledExecutorService

public java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()