org.epics.pvmanager.util
Class Executors

java.lang.Object
  extended by org.epics.pvmanager.util.Executors

public class Executors
extends java.lang.Object

Factory and utility methods to for the Executor framework.

Author:
carcassi

Constructor Summary
Executors()
           
 
Method Summary
static java.util.concurrent.Executor localThread()
          Executes tasks on the current thread.
static java.util.concurrent.ThreadFactory namedPool(java.lang.String poolName)
          A thread factory where each new thread starts with the given name.
static java.util.concurrent.Executor swingEDT()
          Executes tasks on the Swing Event Dispatch Thread using SwingUtilities.invokeLater().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Executors

public Executors()
Method Detail

swingEDT

public static java.util.concurrent.Executor swingEDT()
Executes tasks on the Swing Event Dispatch Thread using SwingUtilities.invokeLater().

Returns:
an executor that posts events on the EDT

localThread

public static java.util.concurrent.Executor localThread()
Executes tasks on the current thread.

Returns:
an object that runs tasks on the current thread

namedPool

public static java.util.concurrent.ThreadFactory namedPool(java.lang.String poolName)
A thread factory where each new thread starts with the given name. The name of the thread will be poolname + number. This can be used instead of Executors.defaultThreadFactory(), which unfortunately only use generic names for the thread, which makes it harder to debug.

Parameters:
poolName - name of the pool
Returns:
a new factory