| Modifier | Constructor and Description |
|---|---|
protected |
PooledThread(ThreadPool threadPool,
String name,
boolean isDaemon,
Integer threadPriority)
Create the PooledThread.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
assignWork(Work work)
Assign work to this thread.
|
long |
getLastUsedTime()
Returns the time this thread was last used.
|
String |
getName()
return the name of the thread.
|
int |
getTotalWorkCount()
The total number of jobs this thread has run.
|
long |
getTotalWorkExecutionTime()
The total time for performing all assigned work.
|
Work |
getWork()
Returns the currently executing work, otherwise null.
|
void |
interrupt()
Try to interrupt the thread.
|
boolean |
isStopped()
Returns true if the thread has finished.
|
void |
run()
process any assigned work until stopped or interrupted.
|
protected void |
start() |
protected void |
stop()
Stop the thread relatively nicely.
|
String |
toString() |
protected PooledThread(ThreadPool threadPool, String name, boolean isDaemon, Integer threadPriority)
protected void start()
public boolean assignWork(Work work)
public void run()
public void interrupt()
If the Thread was interrupted then it will be removed from the pool.
public boolean isStopped()
protected void stop()
public String getName()
public Work getWork()
public int getTotalWorkCount()
public long getTotalWorkExecutionTime()
public long getLastUsedTime()
Copyright © 2014. All Rights Reserved.