groovyx.gpars
Class GParsConfig
java.lang.Object
groovyx.gpars.GParsConfig
public final class GParsConfig
- extends java.lang.Object
Enables to specify custom thread pools and timers to run GPars in hosted environments, such as GAE
- Author:
- Vaclav Pech
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
poolFactory
private static volatile PoolFactory poolFactory
timerFactory
private static volatile TimerFactory timerFactory
poolFactoryFlag
private static volatile boolean poolFactoryFlag
timerFactoryFlag
private static volatile boolean timerFactoryFlag
GParsConfig
public GParsConfig()
setPoolFactory
public static void setPoolFactory(PoolFactory pool)
getPoolFactory
public static PoolFactory getPoolFactory()
retrieveDefaultPool
public static Pool retrieveDefaultPool()
- If a pool factory has been set, it will be used to create a new thread pool.
Otherwise a new instance of ResizeablePool will be returned.
- Returns:
- A thread pool instance to use for default parallel groups (actors, dataflow)
setTimerFactory
public static void setTimerFactory(TimerFactory timerFactory)
getTimerFactory
public static TimerFactory getTimerFactory()
retrieveDefaultTimer
public static GeneralTimer retrieveDefaultTimer(java.lang.String name,
boolean daemon)
- If a timer factory has been set, it will be used to create a timer.
Otherwise a new instance of java.util.Timer will be created, wrapped inside a GeneralTimer instance and returned.
- Returns:
- A timer instance to use to handle timeouts (actors, GParsPool, GParsExecutorsPool)