|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.oddjob.framework.BaseComponent
org.oddjob.framework.BasePrimary
org.oddjob.scheduling.ScheduleBase
public abstract class ScheduleBase
Common functionality for jobs that schedule things.
| Field Summary | |
|---|---|
protected CountDownLatch |
begun
|
protected ChildHelper<Runnable> |
childHelper
Track the child. |
protected StateExchange |
childStateReflector
|
protected ParentStateHandler |
stateHandler
Fires state events. |
protected boolean |
stop
Stop flag. |
protected StructuralStateHelper |
structuralState
|
| Fields inherited from class org.oddjob.framework.BaseComponent |
|---|
iconHelper |
| Constructor Summary | |
|---|---|
ScheduleBase()
Default Constructor. |
|
| Method Summary | |
|---|---|
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. |
protected StateChanger<ParentState> |
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 void |
onDestroy()
Subclasses override this method to clear up resources. |
protected void |
onReset()
|
protected void |
onStop()
|
protected void |
postStop()
|
void |
removeStructuralListener(StructuralListener listener)
Remove a listener. |
void |
run()
Implement the main execute method for a job. |
protected void |
setStateStartingAndIconSleeping()
Utility method to set the state to STARTED but the icon to SLEEPING. |
boolean |
softReset()
Perform a soft reset on the job. |
protected ParentStateHandler |
stateHandler()
|
void |
stop()
Implementation for a typical stop. |
| Methods inherited from class org.oddjob.framework.BasePrimary |
|---|
configure, getName, logger, logger, loggerName, save, setName, toString |
| Methods inherited from class org.oddjob.framework.BaseComponent |
|---|
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.oddjob.Stateful |
|---|
addStateListener, lastStateEvent, removeStateListener |
| Field Detail |
|---|
protected transient ParentStateHandler stateHandler
protected transient ChildHelper<Runnable> childHelper
protected transient StructuralStateHelper structuralState
protected transient StateExchange childStateReflector
protected transient volatile boolean stop
protected transient CountDownLatch begun
| Constructor Detail |
|---|
public ScheduleBase()
| Method Detail |
|---|
protected ParentStateHandler stateHandler()
stateHandler in class BaseComponentprotected StateChanger<ParentState> getStateChanger()
protected abstract StateOperator getStateOp()
protected abstract void begin()
throws ComponentPersistException
ComponentPerisistException - If the scheduled time can't be saved.
ComponentPersistExceptionpublic final void run()
run in interface Runnableprotected final void setStateStartingAndIconSleeping()
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 StoppableFailedToStopExceptionprotected void onStop()
protected void postStop()
public boolean softReset()
softReset in interface Resetablepublic boolean hardReset()
hardReset in interface Resetableprotected void onReset()
public void addStructuralListener(StructuralListener listener)
addStructuralListener in interface Structurallistener - The listener.public void removeStructuralListener(StructuralListener listener)
removeStructuralListener in interface Structurallistener - The listner.protected void onDestroy()
BaseComponent
onDestroy in class BaseComponentprotected void fireDestroyedState()
fireDestroyedState in class BaseComponent
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||