org.oddjob.state
Class Resets

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.BasePrimary
          extended by org.oddjob.framework.StructuralJob<Object>
              extended by org.oddjob.state.Resets
All Implemented Interfaces:
Serializable, Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful, Stoppable, Structural

public class Resets
extends StructuralJob<Object>

Description

Captures Reset actions propagating down a job tree and either hardens soft resets to hard resets or softens hard resets to soft resets before passing them on to the child job.

Execute and Stop actions are cascaded as normal to the child job.

See also the ResetJob job.

Example

Examples elsewhere.
See Also:
Serialized Form
Author:
Rob Gordon

Field Summary
 
Fields inherited from class org.oddjob.framework.StructuralJob
childHelper, childStateReflector, stateHandler, stop, structuralState
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
Resets()
           
 
Method Summary
protected  void execute()
          Execute this job.
protected  StateOperator getInitialStateOp()
          Subclasses must provide the StateOperator that will decide how to evaluate the children's state.
 boolean hardReset()
          Perform a hard reset on the job.
 boolean isHarden()
           
 boolean isSoften()
           
 void setHarden(boolean harden)
           
 void setJob(Object job)
           
 void setSoften(boolean soften)
           
 boolean softReset()
          Perform a soft reset on the job.
 
Methods inherited from class org.oddjob.framework.StructuralJob
addStructuralListener, fireDestroyedState, force, getStateChanger, isStop, onDestroy, onReset, onStop, removeStructuralListener, run, startChildStateReflector, stateHandler, stop
 
Methods inherited from class org.oddjob.framework.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toString
 
Methods inherited from class org.oddjob.framework.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 

Constructor Detail

Resets

public Resets()
Method Detail

getInitialStateOp

protected StateOperator getInitialStateOp()
Description copied from class: StructuralJob
Subclasses must provide the StateOperator that will decide how to evaluate the children's state.

Specified by:
getInitialStateOp in class StructuralJob<Object>
Returns:
A State Operator. Must not be null.

execute

protected void execute()
                throws Throwable
Description copied from class: StructuralJob
Execute this job.

Specified by:
execute in class StructuralJob<Object>
Throws:
Exception - If the unexpected occurs.
Throwable

isHarden

public boolean isHarden()

setHarden

public void setHarden(boolean harden)

isSoften

public boolean isSoften()

setSoften

public void setSoften(boolean soften)

setJob

public void setJob(Object job)

Property: job

Description: The job to pass resets on to.

Required: Yes.


hardReset

public boolean hardReset()
Description copied from class: StructuralJob
Perform a hard reset on the job.

Specified by:
hardReset in interface Resetable
Overrides:
hardReset in class StructuralJob<Object>
Returns:
true if successful.

softReset

public boolean softReset()
Description copied from class: StructuralJob
Perform a soft reset on the job.

Specified by:
softReset in interface Resetable
Overrides:
softReset in class StructuralJob<Object>
Returns:
true if successful.