|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.utils.threading.AbstractPool
An abstract implementation of the ThreadPool interface which implements the totalThreads(), idleThreads(), signalThreadIdle(), signalThreadWorking(), and destroy() methods.
Constructor Summary | |
AbstractPool(int minThreads,
int maxThreads,
int threadPriority)
AbstractPool Construcutor |
Method Summary | |
int |
busyThreads()
Gives the number of busy (working) worker threads in the pool |
void |
destroy()
Destroys the pool and all it's threads. |
abstract void |
destroyThread(java.lang.Thread thread)
Destroys the pooled thread |
abstract WorkTracker |
execute(WorkerTask task)
Queues up a task to be executed. |
java.lang.Thread |
getPooledThread()
Gets the thread from the pool |
int |
idleThreads()
Gives the number of idle threads in the pool |
void |
lockThread(java.lang.Thread thread)
Locks the thread for running |
void |
releaseThread(java.lang.Thread thread)
Releases the thread to the pool |
int |
totalThreads()
Gives the total number of threads in the pool |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractPool(int minThreads, int maxThreads, int threadPriority)
minThreads
- the min number of worker threads that can be in this poolmaxThreads
- the max number of worker threads that can be in this poolthreadPriority
- the priority these worker threads should haveMethod Detail |
public abstract WorkTracker execute(WorkerTask task) throws java.lang.IllegalStateException
execute
in interface ThreadPool
task
- the task to be executed
java.lang.IllegalStateException
- - thrown if the pool has been destroyedpublic abstract void destroyThread(java.lang.Thread thread)
destroyThread
in interface ThreadPool
thread
- the thread to be destroyedpublic void destroy()
destroy
in interface ThreadPool
public int totalThreads() throws java.lang.IllegalStateException
totalThreads
in interface ThreadPool
java.lang.IllegalStateException
public int idleThreads() throws java.lang.IllegalStateException
idleThreads
in interface ThreadPool
java.lang.IllegalStateException
public int busyThreads() throws java.lang.IllegalStateException
busyThreads
in interface ThreadPool
java.lang.IllegalStateException
public void releaseThread(java.lang.Thread thread) throws java.lang.Exception
releaseThread
in interface ThreadPool
thread
- the thread to be released
java.lang.Exception
public void lockThread(java.lang.Thread thread) throws java.lang.Exception
lockThread
in interface ThreadPool
thread
- the thread to be locked
java.lang.Exception
public java.lang.Thread getPooledThread() throws java.lang.Exception
getPooledThread
in interface ThreadPool
java.lang.Exception
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |