org.oddjob.values
Class SetJob

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.BasePrimary
          extended by org.oddjob.framework.SimpleJob
              extended by org.oddjob.values.SetJob
All Implemented Interfaces:
Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful

public class SetJob
extends SimpleJob

Description

A job which sets properties in other jobs when it executes.

Example

Setting lots of properties.
<oddjob>
    <job>
        <sequential>
            <jobs>
                <set>
                    <values>
                        <value key="check.checkBoolean" value="true"/>
                        <value key="check.checkByte" value="127"/>
                        <value key="check.checkChar" value="a"/>
                        <date key="check.checkDate" date="2005-12-25" timeZone="GMT"/>
                        <value key="check.checkDouble" value="9E99"/>
                        <value key="check.checkFloat" value="1.23"/>
                        <value key="check.checkInt" value="1234567"/>
                        <value key="check.checkLong" value="2345678"/>
                        <value key="check.checkShort" value="123"/>
                        <value key="check.checkString" value="hello"/>
                    </values>
                </set>
                <bean id="check" class="org.oddjob.values.CheckBasicSetters"/>
            </jobs>
        </sequential>
    </job>
</oddjob>
This is the configuration for one of the tests.

Field Summary
 
Fields inherited from class org.oddjob.framework.SimpleJob
stateHandler, stop
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
SetJob()
           
 
Method Summary
protected  int execute()
          Execute this job.
 void setValues(String name, ArooaValue value)
          Add a name value pair.
 
Methods inherited from class org.oddjob.framework.SimpleJob
fireDestroyedState, force, getStateChanger, hardReset, onDestroy, onReset, onStop, run, sleep, softReset, 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

SetJob

public SetJob()
Method Detail

setValues

public void setValues(String name,
                      ArooaValue value)
Add a name value pair.

Property: values

Description: The thing to set on the property that is given by the key of this mapped property.

Required: No, but pointless if not provided.

Parameters:
name - The name of the variable.
value - The runtime configurable for the value.

execute

protected int execute()
               throws Exception
Description copied from class: SimpleJob
Execute this job.

Specified by:
execute in class SimpleJob
Returns:
0 if the job is complete, anything else otherwise.
Throws:
Exception - If the unexpected occurs.