org.oddjob.state
Class BaseStateChanger<S extends State>

java.lang.Object
  extended by org.oddjob.state.BaseStateChanger<S>
Type Parameters:
S - The type of State.
All Implemented Interfaces:
StateChanger<S>
Direct Known Subclasses:
JobStateChanger, ParentStateChanger, ServiceStateChanger

public class BaseStateChanger<S extends State>
extends Object
implements StateChanger<S>

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
BaseStateChanger(StateHandler<S> stateHandler, IconHelper iconHelper, Persistable persistable, S exceptionState)
           
 
Method Summary
 void setState(S state)
          Set the state to given state.
 void setState(S state, Date date)
          Set the state to the given state with the given event time.
 void setStateException(Throwable t)
          Set the state to an EXCEPTION state.
 void setStateException(Throwable t, Date date)
          Set the state to an EXCEPTION state with the given event time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseStateChanger

public BaseStateChanger(StateHandler<S> stateHandler,
                        IconHelper iconHelper,
                        Persistable persistable,
                        S exceptionState)
Method Detail

setState

public void setState(S state)
Description copied from interface: StateChanger
Set the state to given state.

Specified by:
setState in interface StateChanger<S extends State>

setState

public void setState(S state,
                     Date date)
Description copied from interface: StateChanger
Set the state to the given state with the given event time.

Specified by:
setState in interface StateChanger<S extends State>

setStateException

public void setStateException(Throwable t)
Description copied from interface: StateChanger
Set the state to an EXCEPTION state.

Specified by:
setStateException in interface StateChanger<S extends State>
Parameters:
t - The Exception.

setStateException

public void setStateException(Throwable t,
                              Date date)
Description copied from interface: StateChanger
Set the state to an EXCEPTION state with the given event time.

Specified by:
setStateException in interface StateChanger<S extends State>
Parameters:
t - The Exception.