Package org.oddjob.state
Class BaseStateChanger<S extends State>
java.lang.Object
org.oddjob.state.BaseStateChanger<S>
- Type Parameters:
S- The type of State.
- All Implemented Interfaces:
StateChanger<S>
- Direct Known Subclasses:
EventStateChanger,JobStateChanger,ParentStateChanger,ServiceStateChanger,TimerStateChanger
Base functionality for changing
State. This utility class is
responsible for notifying the change with the StateHandler,
changing the icon, and persisting the job if necessary.- Author:
- rob
-
Constructor Summary
ConstructorsConstructorDescriptionBaseStateChanger(StateHandler<S> stateHandler, IconHelper iconHelper, Persistable persistable, S exceptionState) -
Method Summary
Modifier and TypeMethodDescriptionvoidSet the state to given state.voidsetState(S state, StateInstant stateInstant) Set the state to the given state with the given event time.voidSet the state to an EXCEPTION state.voidsetStateException(Throwable t, StateInstant instant) Set the state to an EXCEPTION state with the given event time.
-
Constructor Details
-
BaseStateChanger
public BaseStateChanger(StateHandler<S> stateHandler, IconHelper iconHelper, Persistable persistable, S exceptionState)
-
-
Method Details
-
setState
Description copied from interface:StateChangerSet the state to given state.- Specified by:
setStatein interfaceStateChanger<S extends State>- Parameters:
state- The state.
-
setState
Description copied from interface:StateChangerSet the state to the given state with the given event time.- Specified by:
setStatein interfaceStateChanger<S extends State>- Parameters:
state- The state.stateInstant- The unique event time.
-
setStateException
Description copied from interface:StateChangerSet the state to an EXCEPTION state.- Specified by:
setStateExceptionin interfaceStateChanger<S extends State>- Parameters:
t- The Exception.
-
setStateException
Description copied from interface:StateChangerSet the state to an EXCEPTION state with the given event time.- Specified by:
setStateExceptionin interfaceStateChanger<S extends State>- Parameters:
t- The Exception.instant- The unique event time.
-