examples.util.concurrent
Class AsynchronousManager
java.lang.Object
examples.util.concurrent.AsynchronousManager
- public class AsynchronousManager
- extends java.lang.Object
Manages the thread pool for all the asynchronous invocations.
- Author:
| Method Summary |
protected void |
createBoundedThreadPool(int threadPoolMaxSize, int threadPoolMinSize, int threadPoolInitSize, int keepAliveTime, boolean waitWhenBlocked)
Creates a bounded thread pool. |
protected void |
createDynamicThreadPool(int threadPoolMinSize, int threadPoolInitSize, int keepAliveTime)
Creates a dynamic thread pool. |
void |
execute(java.lang.Runnable task)
Executes a task in a thread from the thread pool. |
static AsynchronousManager |
getInstance()
Returns the one A only AsynchronousManager instance. |
void |
initialize(Definition definition)
Initializes the thread pool. |
protected boolean |
notInitialized()
Checks if the service has been initialized. |
void |
stop()
Closes down the thread pool. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
protected static final AsynchronousManager INSTANCE
-
m_threadPool
protected PooledExecutor m_threadPool
-
m_initialized
protected boolean m_initialized
-
AsynchronousManager
protected AsynchronousManager()
-
Private constructor.
execute
public void execute(java.lang.Runnable task)
-
Executes a task in a thread from the thread pool.
-
- Parameters:
task - the task to execute (Runnable)
getInstance
public static AsynchronousManager getInstance()
-
Returns the one A only AsynchronousManager instance.
-
- Returns:
- the asynchronous manager
initialize
public void initialize(Definition definition)
-
Initializes the thread pool.
-
stop
public void stop()
-
Closes down the thread pool.
-
createBoundedThreadPool
protected void createBoundedThreadPool(int threadPoolMaxSize,
int threadPoolMinSize,
int threadPoolInitSize,
int keepAliveTime,
boolean waitWhenBlocked)
-
Creates a bounded thread pool.
-
- Parameters:
threadPoolMaxSize -
threadPoolMinSize -
threadPoolInitSize -
keepAliveTime -
waitWhenBlocked -
createDynamicThreadPool
protected void createDynamicThreadPool(int threadPoolMinSize,
int threadPoolInitSize,
int keepAliveTime)
-
Creates a dynamic thread pool.
-
- Parameters:
threadPoolMinSize -
threadPoolInitSize -
keepAliveTime -
notInitialized
protected boolean notInitialized()
-
Checks if the service has been initialized.
-
- Returns:
- boolean
Please see keelframework.org for information about new Keel releases.