|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The RunnableManager interface describes the functionality of an implementation running commands in the background.
| Field Summary | |
static String |
ROLE
The role name |
| Method Summary | |
ThreadPool |
createPool(int queueSize,
int maxPoolSize,
int minPoolSize,
int priority,
boolean isDaemon,
long keepAliveTime,
String blockPolicy,
boolean shutdownGraceful,
int shutdownWaitTime)
Create a private ThreadPool with a specific ThreadFactory |
ThreadPool |
createPool(String name,
int queueSize,
int maxPoolSize,
int minPoolSize,
int priority,
boolean isDaemon,
long keepAliveTime,
String blockPolicy,
boolean shutdownGraceful,
int shutdownWaitTime)
Create a shared ThreadPool with a specific ThreadFactory |
void |
execute(Runnable command)
Immediate Execution of a runnable in the background |
void |
execute(Runnable command,
long delay)
Immediate Execution of a runnable in the background |
void |
execute(Runnable command,
long delay,
long interval)
Immediate Execution of a runnable in the background |
void |
execute(String threadPoolName,
Runnable command)
Immediate Execution of a runnable in the background |
void |
execute(String threadPoolName,
Runnable command,
long delay)
Immediate Execution of a runnable in the background |
void |
execute(String threadPoolName,
Runnable command,
long delay,
long interval)
Delayed and repeated Execution of a runnable in the background |
ThreadPool |
getPool(String name)
Get a thread pool |
void |
remove(Runnable command)
Remove a Runnable from the execution stack |
| Field Detail |
public static final String ROLE
| Method Detail |
public ThreadPool createPool(String name,
int queueSize,
int maxPoolSize,
int minPoolSize,
int priority,
boolean isDaemon,
long keepAliveTime,
String blockPolicy,
boolean shutdownGraceful,
int shutdownWaitTime)
ThreadFactory
name - The name of the thread poolqueueSize - The size of the queuemaxPoolSize - The maximum number of threadsminPoolSize - The maximum number of threadspriority - The priority of threads created by this pool. This is
one of Thread.MIN_PRIORITY, Thread.NORM_PRIORITY, or Thread.MAX_PRIORITYisDaemon - Whether or not thread from the pool should run in daemon
modekeepAliveTime - How long should a thread be alive for new work to
be done before it is GCedblockPolicy - What's the blocking policy is resources are exhaustedshutdownGraceful - Should we wait for the queue to finish all
pending commands?shutdownWaitTime - After what time a normal shutdown should take
into account if a graceful shutdown has not come to an end
public ThreadPool createPool(int queueSize,
int maxPoolSize,
int minPoolSize,
int priority,
boolean isDaemon,
long keepAliveTime,
String blockPolicy,
boolean shutdownGraceful,
int shutdownWaitTime)
ThreadFactory
queueSize - The size of the queuemaxPoolSize - The maximum number of threadsminPoolSize - The maximum number of threadspriority - The priority of threads created by this pool. This is
one of Thread.MIN_PRIORITY, Thread.NORM_PRIORITY, or Thread.MAX_PRIORITYisDaemon - Whether or not thread from the pool should run in daemon
modekeepAliveTime - How long should a thread be alive for new work to
be done before it is GCedblockPolicy - What's the blocking policy is resources are exhaustedshutdownGraceful - Should we wait for the queue to finish all
pending commands?shutdownWaitTime - After what time a normal shutdown should take
into account if a graceful shutdown has not come to an end
ThreadPoolpublic ThreadPool getPool(String name)
name - The name of the thread pool or null for the default pool.public void execute(Runnable command)
command - The command to execute
public void execute(Runnable command,
long delay)
command - The command to executedelay - The delay before first run
public void execute(Runnable command,
long delay,
long interval)
command - The command to executedelay - The delay before first runinterval - The interval of repeated runs
public void execute(String threadPoolName,
Runnable command)
threadPoolName - The thread pool to usecommand - The command to execute
public void execute(String threadPoolName,
Runnable command,
long delay)
threadPoolName - The thread pool to usecommand - The command to executedelay - The delay before first run
public void execute(String threadPoolName,
Runnable command,
long delay,
long interval)
threadPoolName - The thread pool to usecommand - The command to executedelay - The delay before first runinterval - The interval of repeated runspublic void remove(Runnable command)
Runnable from the execution stack
command - The command to be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||