public abstract class ScheduleBase extends BasePrimary implements Runnable, Stoppable, Serializable, Resetable, Stateful, Structural, Forceable
Modifier and Type | Field and Description |
---|---|
protected CountDownLatch |
begun |
protected ChildHelper<Runnable> |
childHelper
Track the child.
|
protected StateExchange<TimerState> |
childStateReflector |
protected TimerStateHandler |
stateHandler
Fires state events.
|
protected boolean |
stop
Stop flag.
|
Constructor and Description |
---|
ScheduleBase()
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addStructuralListener(StructuralListener listener)
Add a listener.
|
protected abstract void |
begin()
Sub classes must override this to submit the first execution.
|
protected void |
fireDestroyedState()
Internal method to fire state.
|
void |
force()
Force something.
|
protected StateChanger<TimerState> |
getStateChanger() |
protected abstract StateOperator |
getStateOp()
Sub classes provide the state operator that is used to calculate the subclasses
completion state.
|
boolean |
hardReset()
Perform a hard reset on the job.
|
protected IconHelper |
iconHelper()
Subclasses must provide a
IconHelper . |
protected void |
onDestroy()
Subclasses override this method to clear up resources.
|
protected void |
onReset()
Override by subclasses to reset state.
|
protected void |
onStop()
Subclasses can override to perform stopping operations.
|
protected void |
postStop()
Subclasses can override to perform actions once children have stopped.
|
void |
removeStructuralListener(StructuralListener listener)
Remove a listener.
|
void |
run()
Implement the main execute method for a job.
|
boolean |
softReset()
Perform a soft reset on the job.
|
protected TimerStateHandler |
stateHandler()
Subclasses must provide a
StateHandler . |
void |
stop()
Implementation for a typical stop.
|
configure, getName, logger, logger, loggerName, save, setName, toString
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addStateListener, lastStateEvent, removeStateListener
protected transient volatile TimerStateHandler stateHandler
protected transient volatile ChildHelper<Runnable> childHelper
protected transient volatile StateExchange<TimerState> childStateReflector
protected transient volatile boolean stop
protected transient volatile CountDownLatch begun
protected TimerStateHandler stateHandler()
BaseComponent
StateHandler
.stateHandler
in class BaseComponent
protected IconHelper iconHelper()
BaseComponent
IconHelper
.iconHelper
in class BaseComponent
protected StateChanger<TimerState> getStateChanger()
protected abstract StateOperator getStateOp()
protected abstract void begin() throws ComponentPersistException
ComponentPerisistException
- If the scheduled time can't be saved.ComponentPersistException
public final void run()
public final void stop() throws FailedToStopException
This stop implementation doesn't check that the job is executing as stop messages must cascade down the hierarchy to manually started jobs.
stop
in interface Stoppable
FailedToStopException
protected void onStop()
protected void postStop()
public boolean softReset()
public boolean hardReset()
protected void onReset()
public void force()
Forceable
public void addStructuralListener(StructuralListener listener)
addStructuralListener
in interface Structural
listener
- The listener.public void removeStructuralListener(StructuralListener listener)
removeStructuralListener
in interface Structural
listener
- The listner.protected void onDestroy()
BaseComponent
onDestroy
in class BaseComponent
protected void fireDestroyedState()
fireDestroyedState
in class BaseComponent