Package org.epics.util.concurrent
Class Executors
- java.lang.Object
-
- org.epics.util.concurrent.Executors
-
public class Executors extends Object
Factory and utility methods to for the Executor framework.- Author:
- carcassi
-
-
Constructor Summary
Constructors Constructor Description Executors()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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().
-
-
-
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 ofExecutors.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
-
-