|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.apache.java.recycle.pool.Worker
This class extends the Thread class to add recyclable functionalities.
Field Summary | |
private boolean |
alive
|
private RecycleBin |
pool
|
private Stoppable |
work
|
Fields inherited from class java.lang.Thread |
contextClassLoader,
daemon,
eetop,
group,
inheritedAccessControlContext,
initial_stack_memory,
MAX_PRIORITY,
MIN_PRIORITY,
name,
NORM_PRIORITY,
priority,
PrivateInfo,
single_step,
stillborn,
stopThreadPermission,
target,
threadInitNumber,
threadQ,
values |
Constructor Summary | |
protected |
Worker(java.lang.ThreadGroup group,
RecycleBin pool,
java.lang.String name)
Allocates a new Worker object. |
Method Summary | |
void |
clean()
Cleans this worker by setting its Work code to null. |
void |
destroy()
Set the alive variable to false causing the worker to die. |
protected void |
execute(Stoppable work)
Set the Work code this Worker must
execute and notifies its thread to do it. |
void |
run()
The main execution loop. |
Methods inherited from class java.lang.Thread |
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
private Stoppable work
private RecycleBin pool
private boolean alive
Constructor Detail |
protected Worker(java.lang.ThreadGroup group, RecycleBin pool, java.lang.String name)
Worker
object.Method Detail |
public final void run()
protected void execute(Stoppable work)
Work
code this Worker
must
execute and notifies its thread to do it.public void clean()
Work
code to null.public void destroy()
alive
variable to false causing the worker to die.
If the worker is stalled and a timeout generated this call, this method
does not change the state of the worker (that must be destroyed in other
ways).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |