[Index]

file-persister


Persist and load jobs from and to a file. The file the job is persisted to is the jobs id with a .ser extension.

A new sub directory is created for each nested Oddjob with an id. The job of the nested Oddjob are persisted to the sub directory. Thus the directory structure mirrors the structure of the Oddjobs.


Property Summary

dir The directory in which the files will be created.
path A '/' delimited path to the location for the persister.

Example Summary

Example 1 Using a file persister with Oddjob.

Property Detail

dir

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The directory in which the files will be created.

path

Configured ByATTRIBUTE
AccessWRITE_ONLY
RequiredNo.

A '/' delimited path to the location for the persister. Normally this is set by nested persisters to be the id of the Oddjob that created them.


Examples

Example 1

Using a file persister with Oddjob. The persist directory is passed in as an argument from the command line. The state of child jobs will be saved in a child directory relative to the given directory of the name 'important-jobs'.

<oddjob id="this">
    <job>
        <oddjob id="important-jobs" file="${this.dir}/FilePersisterExampleInner.xml">
            <persister>
                <file-persister dir="${this.args[0]}"/>
            </persister>
        </oddjob>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present