Class SetJob

All Implemented Interfaces:
Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resettable, 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.

  • Constructor Details

    • SetJob

      public SetJob()
  • Method Details

    • setValues

      public void setValues(String name, ArooaValue value)
      Add a name value pair.
      Parameters:
      name - The name of the variable.
      value - The runtime configurable for the value.
      Reference 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.
    • 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.