final class ThreadActor
extends java.lang.Object
implements java.lang.Runnable
ThreadedTask
, ThreadedSimpleTask
or ThreadedVerySimpleTask
, then wait
for an other one to doModifier and Type | Field and Description |
---|---|
private ThreadElement<?,?,?> |
actualThreadElement
Actual thread task description to do
|
private boolean |
alive
Indicates if the thread is alive
|
private java.lang.Object |
LOCK
For synchronize the access to current task
|
Constructor and Description |
---|
ThreadActor()
Create a new instance of ThreadActor
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
isFree()
Indicates if the thread have nothing to do
|
void |
run()
Do the thread live (wait for task, do the task, wait for task, do the task ,....)
|
(package private) boolean |
setThreadElement(ThreadElement<?,?,?> threadElement)
Define, if the thread is free, the actual task to do
|
(package private) void |
stopActor()
Stop the actor
|
(package private) void |
stopThread(int id)
Stop the thread carry if it is the one who have the given ID
|
private ThreadElement<?,?,?> actualThreadElement
private boolean alive
private final java.lang.Object LOCK
boolean isFree()
true
if the thread have nothing to doboolean setThreadElement(ThreadElement<?,?,?> threadElement)
threadElement
- Task to dotrue
if the settings have done. false
if the settings not do because the thread already on doing a
taskvoid stopActor()
void stopThread(int id)
id
- ID of thread to stoppublic void run()
run
in interface java.lang.Runnable
Thread.run()