eu.emi.dsr.core
Class RegistryThreadPool

java.lang.Object
  extended by eu.emi.dsr.core.RegistryThreadPool

public class RegistryThreadPool
extends Object

It lowers the overhead of extraordinary thread creation within a container pre-configured size of thread pool. Most of the code is taken from ://unicore.svn.sourceforge.net/viewvc/unicore/wsrflite/tags/use-2.0 .1/core/src /main/java/de/fzj/unicore/wsrflite/ResourcePool.java?revision=10715 &view=markup

Author:
a.memon

Field Summary
static String CORE_POOL_SIZE
          property key for setting the core thread pool size for the scheduled execution service
static String EXEC_CORE_POOL_SIZE
          property key for setting the minimum thread pool size for the scheduled execution service
static String EXEC_MAX_POOL_SIZE
          property key for setting the maximum thread pool size for the scheduled execution service
static String EXEC_POOL_TIMEOUT
          property key for setting the timeout in millis for removing idle threads
static String POOL_TIMEOUT
          property key for setting the timeout in millis for removing idle threads
 
Method Summary
protected static void configure()
          Configure the pool.
protected static void configureExecutor()
           
protected static void configureScheduler()
           
static
<V> CompletionService<V>
getCompletionService()
          get an CompletionService using the Exector service
static int getExecutorActiveThreadCount()
           
static int getExecutorCorePoolSize()
           
static int getExecutorMaxPoolSize()
           
static ExecutorService getExecutorService()
          get a ExecutorService for executing tasks
static int getScheduledExecutorActiveThreadCount()
          get the number of currently active threads in the scheduler pool
static int getScheduledExecutorCorePoolSize()
          get the current minimum pool size of the scheduler pool
static int getScheduledExecutorMaxPoolSize()
          get the current maximum pool size of the scheduler pool
static ScheduledExecutorService getScheduledExecutorService()
          get a ScheduledExecutorService for executing tasks at a given schedule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_POOL_SIZE

public static final String CORE_POOL_SIZE
property key for setting the core thread pool size for the scheduled execution service

See Also:
Constant Field Values

POOL_TIMEOUT

public static final String POOL_TIMEOUT
property key for setting the timeout in millis for removing idle threads

See Also:
Constant Field Values

EXEC_CORE_POOL_SIZE

public static final String EXEC_CORE_POOL_SIZE
property key for setting the minimum thread pool size for the scheduled execution service

See Also:
Constant Field Values

EXEC_MAX_POOL_SIZE

public static final String EXEC_MAX_POOL_SIZE
property key for setting the maximum thread pool size for the scheduled execution service

See Also:
Constant Field Values

EXEC_POOL_TIMEOUT

public static final String EXEC_POOL_TIMEOUT
property key for setting the timeout in millis for removing idle threads

See Also:
Constant Field Values
Method Detail

getScheduledExecutorService

public static ScheduledExecutorService getScheduledExecutorService()
get a ScheduledExecutorService for executing tasks at a given schedule

Returns:

getExecutorService

public static ExecutorService getExecutorService()
get a ExecutorService for executing tasks

Returns:
ExecutorService

getCompletionService

public static <V> CompletionService<V> getCompletionService()
get an CompletionService using the Exector service

Type Parameters:
V -
Returns:

configure

protected static void configure()
Configure the pool. Properties are read from the Kernel properties.


configureScheduler

protected static void configureScheduler()

configureExecutor

protected static void configureExecutor()

getScheduledExecutorCorePoolSize

public static int getScheduledExecutorCorePoolSize()
get the current minimum pool size of the scheduler pool


getScheduledExecutorMaxPoolSize

public static int getScheduledExecutorMaxPoolSize()
get the current maximum pool size of the scheduler pool


getScheduledExecutorActiveThreadCount

public static int getScheduledExecutorActiveThreadCount()
get the number of currently active threads in the scheduler pool


getExecutorCorePoolSize

public static int getExecutorCorePoolSize()

getExecutorMaxPoolSize

public static int getExecutorMaxPoolSize()

getExecutorActiveThreadCount

public static int getExecutorActiveThreadCount()


Copyright © 2012. All Rights Reserved.