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

java.lang.Object
  extended by org.oddjob.state.OrderedStateChanger<S>
All Implemented Interfaces:
StateChanger<S>

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

A StateChanger that uses a StateLock to ensure updates or ordered.

Author:
rob

Constructor Summary
OrderedStateChanger(StateChanger<S> stateChanger, StateLock stateLock)
           
 
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

OrderedStateChanger

public OrderedStateChanger(StateChanger<S> stateChanger,
                           StateLock stateLock)
Method Detail

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.

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.

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>

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>