|
Trull | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.luc.cs.trull.EmptyComponent
edu.luc.cs.trull.TerminatingComponent
edu.luc.cs.trull.task.AbstractTaskWorker
abstract class AbstractTaskWorker
A Worker for the step-by-step execution of a Task using an Executor.
Task| Field Summary | |
|---|---|
protected boolean |
firstTime
A variable indicating whether the task is being executed for the first time. |
private static org.apache.log4j.Logger |
logger
|
protected static int |
RUNNING
The running state. |
protected java.lang.Runnable |
start
The Runnable for starting work on the task. |
protected EDU.oswego.cs.dl.util.concurrent.WaitableInt |
state
The variable holding the current state. |
protected static int |
STOPPED
The stopped state. |
protected static int |
SUSPENDED
The suspended state. |
protected Task |
task
The task executed by this worker. |
| Constructor Summary | |
|---|---|
AbstractTaskWorker(Task task)
Constructs a worker for the given task. |
|
| Method Summary | |
|---|---|
protected abstract EDU.oswego.cs.dl.util.concurrent.Executor |
getExecutor()
The executor used by this worker to schedule portions of the work. |
void |
resume()
Resumes this suspendable component. |
protected void |
setStart(java.lang.Runnable start)
Sets the Runnable for starting the work. |
void |
setTask(Task task)
Sets the task to be performed. |
void |
start(java.beans.PropertyChangeEvent incoming)
Starts this startable component. |
void |
stop()
Stops this startable component. |
void |
suspend()
Suspends this suspendable component. |
| Methods inherited from class edu.luc.cs.trull.TerminatingComponent |
|---|
fireTermination, getParent, getTermEvent, scheduleTermination, setTerminationListener |
| Methods inherited from class edu.luc.cs.trull.EmptyComponent |
|---|
addPropertyChangeListener, getPropertyChangeListeners, getTerminationListener, propertyChange, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean firstTime
private static org.apache.log4j.Logger logger
protected static final int RUNNING
protected java.lang.Runnable start
protected final EDU.oswego.cs.dl.util.concurrent.WaitableInt state
protected static final int STOPPED
protected static final int SUSPENDED
protected Task task
| Constructor Detail |
|---|
public AbstractTaskWorker(Task task)
task - the task to be performed.
java.lang.IllegalArgumentException - if the task is null.| Method Detail |
|---|
protected abstract EDU.oswego.cs.dl.util.concurrent.Executor getExecutor()
public void resume()
Suspendable
resume in interface Suspendableresume in class EmptyComponentprotected void setStart(java.lang.Runnable start)
start - public void setTask(Task task)
task - the task to be performed.
java.lang.IllegalArgumentException - if the task is null.public void start(java.beans.PropertyChangeEvent incoming)
Startable
start in interface Startablestart in class EmptyComponentincoming - the event that triggered the invocation of this method. May be null.public void stop()
Startable
stop in interface Startablestop in class EmptyComponentpublic void suspend()
Suspendable
suspend in interface Suspendablesuspend in class EmptyComponent
|
Trull | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||