[Index]

reset


A job which resets another job. This job is useful to reset jobs or services that have been persisted, and loaded back in their previous COMPLETE states. The reset can be used to set them back to READY.

A reset might also be needed before running a job elsewhere such as on a remote server.

As of version 1.4 of Oddjob, this job can now also be used to force jobs that are org.oddjob.Forceable by specify 'force' as level.

This job is not Serializable and so won't be persisted itself.

See also the state:resets job.


Property Summary

job Job to reset.
level The reset level, hard or soft
name A name, can be any text.
stop This flag is set by the stop method and should be examined by any Stoppable jobs in their processing loops.

Example Summary

Example 1 Using reset in explorer.xml.
Example 2 Force a job to complete.

Property Detail

job

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredYes.

Job to reset.

level

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo, defaults to soft.

The reset level, hard or soft

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

A name, can be any text.

stop

AccessREAD_ONLY
RequiredRead Only.

This flag is set by the stop method and should be examined by any Stoppable jobs in their processing loops.


Examples

Example 1

Using reset in explorer.xml.

Look at the explorer.xml file in Oddjob's home directory. This file is loaded by the default oddjob.xml file when Oddjob first runs. The explorer.xml configuration is run with a file-persister persister that persists the Explorers state when it completes. When Oddjob is run again the Explorer will be loaded with it's previous COMPLETE state and so won't run. The reset is necessary to set it back to READY.

Example 2

Force a job to complete.

<oddjob>
    <job>
        <sequential>
            <jobs>
                <reset job="${echo}" level="force"/>
                <echo id="echo">You will never see this!</echo>
            </jobs>
        </sequential>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present