|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The ThreadPool interface gives access to methods needed to inspect and use of a pool of threads
| Field Summary | |
static String |
DEFAULT_BLOCK_POLICY
The default shutdown waittime time |
static boolean |
DEFAULT_DAEMON_MODE
The default daemon mode |
static long |
DEFAULT_KEEP_ALIVE_TIME
The default keep alive time |
static int |
DEFAULT_MAX_POOL_SIZE
The default maximum pool size |
static int |
DEFAULT_MIN_POOL_SIZE
The default minimum pool size |
static int |
DEFAULT_QUEUE_SIZE
The default queue size |
static boolean |
DEFAULT_SHUTDOWN_GRACEFUL
The default way to shutdown gracefully |
static int |
DEFAULT_SHUTDOWN_WAIT_TIME
The default shutdown waittime time |
static String |
DEFAULT_THREAD_PRIORITY
The default thread priority |
static String |
DEFAULT_THREADPOOL_NAME
The default shutdown waittime time |
static String |
POLICY_ABORT
ThreadPool block policy ABORT |
static String |
POLICY_DISCARD
ThreadPool block policy DISCARD |
static String |
POLICY_DISCARD_OLDEST
ThreadPool block policy DISCARD-OLDEST |
static String |
POLICY_RUN
ThreadPool block policy RUN |
static String |
POLICY_WAIT
ThreadPool block policy WAIT |
static String |
ROLE
The Role name |
| Method Summary | |
void |
execute(Runnable command)
Execute a command |
String |
getBlockPolicy()
Gets the block policy |
long |
getKeepAliveTime()
Gets the keepAliveTime in milliseconds |
int |
getMaxPoolSize()
Gets the maximum pool size |
int |
getMaxQueueSize()
Gets the maximum queue size |
int |
getMinPoolSize()
Gets the minimum pool size |
String |
getName()
Gets the name of the thread pool |
int |
getPriority()
Gets the priority used to create Threads |
int |
getQueueSize()
Gets the queue size of the thread pool |
int |
getShutdownWaitTimeMs()
Gets the shutdownWaitTime in milliseconds |
boolean |
isDaemon()
Returns true if thread runs as daemon |
boolean |
isQueued()
Whether this DefaultThreadPool has a queue |
boolean |
isShutdownGraceful()
Returns true if shutdown is graceful |
boolean |
isTerminatedAfterShutdown()
Returns true if a shutDown method has succeeded in terminating all threads |
void |
setBlockPolicy(String blockPolicy)
Set the blocking policy |
void |
setDaemon(boolean daemon)
Set to true if thread shall run as daemon |
void |
setKeepAliveTime(long keepAliveTime)
Sets the keepAliveTime in milliseconds |
void |
setMaxPoolSize(int maxPoolSize)
Sets the maximum pool size |
void |
setMinPoolSize(int minPoolSize)
Sets the minimum pool size |
void |
setName(String name)
DOCUMENT ME! |
void |
setPriority(int priority)
Sets the priority of this thread pool: Thread.MIN_PRIORITY,
Thread.NORM_PRIORITY, or Thread.MAX_PRIORITY |
void |
setQueueSize(int queueSize)
Sets the queue size of the thread pool |
void |
setShutdownGraceful(boolean shutdownGraceful)
Sets the shutdownGraceful (true if graceful) |
void |
setShutdownWaitTimeMs(int shutdownWaitTimeMs)
Sets the shutdownWaitTime in milliseconds |
void |
shutdown()
Terminates all threads possibly awaiting processing all elements currently in queue. |
| Field Detail |
public static final int DEFAULT_QUEUE_SIZE
public static final int DEFAULT_MAX_POOL_SIZE
public static final int DEFAULT_MIN_POOL_SIZE
public static final String DEFAULT_THREAD_PRIORITY
public static final boolean DEFAULT_DAEMON_MODE
public static final long DEFAULT_KEEP_ALIVE_TIME
public static final boolean DEFAULT_SHUTDOWN_GRACEFUL
public static final int DEFAULT_SHUTDOWN_WAIT_TIME
public static final String DEFAULT_THREADPOOL_NAME
public static final String DEFAULT_BLOCK_POLICY
public static final String POLICY_ABORT
public static final String POLICY_DISCARD
public static final String POLICY_DISCARD_OLDEST
public static final String POLICY_RUN
public static final String POLICY_WAIT
public static final String ROLE
| Method Detail |
public String getBlockPolicy()
public int getMaxQueueSize()
public String getName()
public int getPriority()
Thread.MIN_PRIORITY, Thread.NORM_PRIORITY,
or Thread.MAX_PRIORITYpublic int getQueueSize()
public boolean isQueued()
public void execute(Runnable command)
throws InterruptedException
command - The Runnable to execute
InterruptedException - In case of interruptionpublic void setBlockPolicy(String blockPolicy)
blockPolicy - The blocking policy valuepublic void setName(String name)
name - The name to set.public void setShutdownGraceful(boolean shutdownGraceful)
shutdownGraceful - The shutdownGraceful to set.public boolean isShutdownGraceful()
public void setShutdownWaitTimeMs(int shutdownWaitTimeMs)
shutdownWaitTimeMs - The shutdownWaitTimeMs to set.public int getShutdownWaitTimeMs()
public long getKeepAliveTime()
public void setKeepAliveTime(long keepAliveTime)
keepAliveTime - the keepAliveTime to setpublic int getMaxPoolSize()
public void setMaxPoolSize(int maxPoolSize)
maxPoolSize - the maxPoolSize to setpublic int getMinPoolSize()
public void setMinPoolSize(int minPoolSize)
minPoolSize - the minPoolSize to setpublic void setPriority(int priority)
Thread.MIN_PRIORITY,
Thread.NORM_PRIORITY, or Thread.MAX_PRIORITY
priority - the priority to setpublic void setQueueSize(int queueSize)
queueSize - the queueSize to setpublic void shutdown()
public boolean isDaemon()
public void setDaemon(boolean daemon)
daemon - the daemon to setpublic boolean isTerminatedAfterShutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||