|
||||||||
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
org.oddjob.scheduling.TimerBase
public abstract class TimerBase
Common functionality for Timers.
Field Summary | |
---|---|
protected Map<Object,Object> |
contextData
Provided to the schedule. |
Fields inherited from class org.oddjob.scheduling.ScheduleBase |
---|
begun, childHelper, childStateReflector, stateHandler, stop, structuralState |
Fields inherited from class org.oddjob.framework.BaseComponent |
---|
iconHelper |
Constructor Summary | |
---|---|
TimerBase()
|
Method Summary | |
---|---|
protected void |
begin()
Sub classes must override this to submit the first execution. |
protected void |
CancelAndStopChild()
Cancel and child jobs that are submitted and stop any that are running. |
Clock |
getClock()
Get the current clock. |
ScheduleResult |
getCurrent()
Get the current/next interval. |
Date |
getLastDue()
Get the last due date. |
protected abstract Interval |
getLimits()
Implementation provided by sub classes so limits are available in scheduleFrom(Date) . |
Date |
getNextDue()
Get the next due date. |
Schedule |
getSchedule()
|
String |
getTimeZone()
Get the time zone id to use in this schedule. |
protected void |
internalSetNextDue(Date nextDue)
Set the next due date. |
protected void |
onReset()
|
protected void |
onStop()
|
protected void |
postStop()
|
protected abstract void |
rescheduleOn(State state)
Implementation provided by sub classes to decide how to reschedule based on the state of the child job. |
protected abstract void |
reset(Resetable job)
Implementation provided by sub classes to decide what kind of reset to send to the child. |
protected void |
scheduleFrom(Date date)
|
void |
setClock(Clock clock)
Set the clock. |
void |
setJob(Runnable job)
|
void |
setNextDue(Date nextDue)
Manually set the Next Due Date. |
void |
setReschedule(Date reSchedule)
|
void |
setSchedule(Schedule schedule)
Set the schedule. |
void |
setScheduleExecutorService(ScheduledExecutorService scheduler)
|
void |
setTimeZone(String timeZoneId)
Set the time zone. |
Methods inherited from class org.oddjob.scheduling.ScheduleBase |
---|
addStructuralListener, fireDestroyedState, getStateChanger, getStateOp, hardReset, onDestroy, removeStructuralListener, run, setStateStartingAndIconSleeping, softReset, stateHandler, 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 final Map<Object,Object> contextData
Constructor Detail |
---|
public TimerBase()
Method Detail |
---|
@Inject public void setScheduleExecutorService(ScheduledExecutorService scheduler)
protected void begin() throws ComponentPersistException
ScheduleBase
begin
in class ScheduleBase
ComponentPersistException
protected void onStop()
onStop
in class ScheduleBase
protected void postStop()
postStop
in class ScheduleBase
protected void onReset()
onReset
in class ScheduleBase
public String getTimeZone()
public void setTimeZone(String timeZoneId)
timeZoneId
- the timeZoneId.public void setSchedule(Schedule schedule)
schedule
- The schedule.public Schedule getSchedule()
public void setReschedule(Date reSchedule) throws ComponentPersistException, OddjobLockedException
Property: reschedule
Description: Reschedule from the given date/time.
Required: Only available once the timer has started.
ComponentPersistException
OddjobLockedException
protected void CancelAndStopChild() throws FailedToStopException
FailedToStopException
protected void scheduleFrom(Date date) throws ComponentPersistException
ComponentPersistException
public Clock getClock()
public void setClock(Clock clock)
clock
- The clock.public void setNextDue(Date nextDue) throws OddjobLockedException
nextDue
- The Next Due Date. May be null.
OddjobLockedException
public Date getNextDue()
protected void internalSetNextDue(Date nextDue) throws ComponentPersistException
nextDue
- The date schedule is next due.
ComponentPersistException
public ScheduleResult getCurrent()
public Date getLastDue()
public void setJob(Runnable job)
Property: job
Description: The job to run when it's due.
Required: Yes.
protected abstract Interval getLimits()
scheduleFrom(Date)
.
protected abstract void rescheduleOn(State state) throws ComponentPersistException
state
- The completion state of the child job.
ComponentPersistException
protected abstract void reset(Resetable job)
job
- The child job that will be reset.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |