public class ThreadRequestPool extends Object
Thread pool that processes a queue of thread requests.
Modifier and Type | Class and Description |
---|---|
protected class |
ThreadRequestPool.ThreadWorker
Thread Worker Inner Class
|
protected class |
ThreadRequestPool.TimedRequestProcessor
Timed Request Processor Thread Inner Class
|
Modifier and Type | Field and Description |
---|---|
static int |
DefaultWorkerThreads |
protected boolean |
m_debug |
protected boolean |
m_timedDebug |
static int |
MaximumWorkerThreads |
static int |
MinimumWorkerThreads |
static int |
TimedQueueInitialSize |
Constructor and Description |
---|
ThreadRequestPool(String threadName)
Class constructor
|
ThreadRequestPool(String threadName,
int poolSize)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfRequests()
Return the number of requests in the queue
|
boolean |
hasDebug()
Check if debug output is enabled
|
boolean |
hasTimedDebug()
Check if timed request debugging is enabled
|
void |
queueRequest(ThreadRequest req)
Queue a request to the thread pool for processing
|
void |
queueRequests(Vector<ThreadRequest> reqList)
Queue a number of requests to the thread pool for processing
|
void |
queueTimedRequest(TimedThreadRequest timedReq)
Queue a timed request to the thread pool for processing at a particular time
|
boolean |
removeTimedRequest(TimedThreadRequest timedReq)
Remove a timed request from the queue
|
void |
setDebug(boolean ena)
Enable/disable debug output
|
void |
setTimedDebug(boolean ena)
Enable/disable timed request debug output
|
void |
shutdownThreadPool()
Shutdown the thread pool and release all resources
|
public static final int DefaultWorkerThreads
public static final int MinimumWorkerThreads
public static final int MaximumWorkerThreads
public static final int TimedQueueInitialSize
protected boolean m_debug
protected boolean m_timedDebug
public ThreadRequestPool(String threadName)
threadName
- Stringpublic ThreadRequestPool(String threadName, int poolSize)
threadName
- StringpoolSize
- intpublic final boolean hasDebug()
public final boolean hasTimedDebug()
public final int getNumberOfRequests()
public final void queueRequest(ThreadRequest req)
req
- ThreadRequestpublic final void queueRequests(Vector<ThreadRequest> reqList)
reqList
- Vectorpublic final void queueTimedRequest(TimedThreadRequest timedReq)
timedReq
- TimedThreadRequestpublic final boolean removeTimedRequest(TimedThreadRequest timedReq)
timedReq
- TimedThreadRequestpublic void shutdownThreadPool()
public final void setDebug(boolean ena)
ena
- booleanpublic final void setTimedDebug(boolean ena)
ena
- booleanCopyright © 2005–2018 Alfresco Software. All rights reserved.