- java.lang.Object
-
- org.praxislive.base.DefaultExecutionContext
-
- All Implemented Interfaces:
org.praxislive.core.ExecutionContext
public class DefaultExecutionContext extends Object implements org.praxislive.core.ExecutionContext
Default implementation ofExecutionContextfor use withAbstractRoot
-
-
Constructor Summary
Constructors Constructor Description DefaultExecutionContext(long time)Create a DefaultExecutionContext
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClockListener(org.praxislive.core.ExecutionContext.ClockListener listener)voidaddStateListener(org.praxislive.core.ExecutionContext.StateListener listener)longgetStartTime()org.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.
-
-
-
Method Detail
-
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
-
-