org.codehaus.gpars

groovyx.gpars
[Java] Class GParsConfig

java.lang.Object
  groovyx.gpars.GParsConfig

public final class GParsConfig

Enables to specify custom thread pools and timers to run GPars in hosted environments, such as GAE

Authors:
Vaclav Pech


Field Summary
private static PoolFactory poolFactory

private static boolean poolFactoryFlag

private static TimerFactory timerFactory

private static boolean timerFactoryFlag

 
Constructor Summary
GParsConfig()

 
Method Summary
static PoolFactory getPoolFactory()

static TimerFactory getTimerFactory()

static Pool retrieveDefaultPool()

If a pool factory has been set, it will be used to create a new thread pool.

static GeneralTimer retrieveDefaultTimer(java.lang.String name, boolean daemon)

If a timer factory has been set, it will be used to create a timer.

static void setPoolFactory(PoolFactory pool)

static void setTimerFactory(TimerFactory timerFactory)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

poolFactory

private static PoolFactory poolFactory


poolFactoryFlag

private static boolean poolFactoryFlag


timerFactory

private static TimerFactory timerFactory


timerFactoryFlag

private static boolean timerFactoryFlag


 
Constructor Detail

GParsConfig

GParsConfig()


 
Method Detail

getPoolFactory

public static PoolFactory getPoolFactory()


getTimerFactory

public static TimerFactory getTimerFactory()


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)


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)


setPoolFactory

public static void setPoolFactory(PoolFactory pool)


setTimerFactory

public static void setTimerFactory(TimerFactory timerFactory)


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.