java.lang.Object
org.praxislive.base.DefaultExecutionContext
- All Implemented Interfaces:
org.praxislive.core.ExecutionContext
Default implementation of
ExecutionContext for use with
AbstractRoot-
Nested Class Summary
Nested classes/interfaces inherited from interface org.praxislive.core.ExecutionContext
org.praxislive.core.ExecutionContext.ClockListener, org.praxislive.core.ExecutionContext.State, org.praxislive.core.ExecutionContext.StateListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClockListener(org.praxislive.core.ExecutionContext.ClockListener listener) voidaddStateListener(org.praxislive.core.ExecutionContext.StateListener listener) longorg.praxislive.core.ExecutionContext.StategetState()longgetTime()voidremoveClockListener(org.praxislive.core.ExecutionContext.ClockListener listener) voidremoveStateListener(org.praxislive.core.ExecutionContext.StateListener listener) protected voidupdateClock(long time) Update the clock time.protected voidupdateState(long time, org.praxislive.core.ExecutionContext.State state) Update the state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.praxislive.core.ExecutionContext
getPeriod
-
Constructor Details
-
DefaultExecutionContext
public DefaultExecutionContext(long time) Create a DefaultExecutionContext- Parameters:
time- initial clock time / start time
-
-
Method Details
-
addStateListener
public void addStateListener(org.praxislive.core.ExecutionContext.StateListener listener) - Specified by:
addStateListenerin interfaceorg.praxislive.core.ExecutionContext
-
removeStateListener
public void removeStateListener(org.praxislive.core.ExecutionContext.StateListener listener) - Specified by:
removeStateListenerin interfaceorg.praxislive.core.ExecutionContext
-
addClockListener
public void addClockListener(org.praxislive.core.ExecutionContext.ClockListener listener) - Specified by:
addClockListenerin interfaceorg.praxislive.core.ExecutionContext
-
removeClockListener
public void removeClockListener(org.praxislive.core.ExecutionContext.ClockListener listener) - Specified by:
removeClockListenerin interfaceorg.praxislive.core.ExecutionContext
-
updateState
protected void updateState(long time, org.praxislive.core.ExecutionContext.State state) Update the state. Will call all state listeners.- Parameters:
time- time of state change (if ACTIVE also the new start time)state- new state- Throws:
IllegalStateException- if attempting to reset to NEW from another state, or attempting to set to another state if current state is TERMINATED
-
getState
public org.praxislive.core.ExecutionContext.State getState()- Specified by:
getStatein interfaceorg.praxislive.core.ExecutionContext
-
updateClock
protected void updateClock(long time) Update the clock time. Will call all clock listeners.- Parameters:
time-
-
getTime
public long getTime()- Specified by:
getTimein interfaceorg.praxislive.core.ExecutionContext
-
getStartTime
public long getStartTime()- Specified by:
getStartTimein interfaceorg.praxislive.core.ExecutionContext
-