org.epics.pvmanager.util
Class Executors

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

public class Executors
extends Object

Factory and utility methods to for the Executor framework.

Author:
carcassi

Constructor Summary
Executors()
           
 
Method Summary
static Executor localThread()
          Executes tasks on the current thread.
static ThreadFactory namedPool(String poolName)
          A thread factory where each new thread starts with the given name.
static 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 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 Executor localThread()
Executes tasks on the current thread.

Returns:
an object that runs tasks on the current thread

namedPool

public static ThreadFactory namedPool(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


Copyright © 2011. All Rights Reserved.