[Index]

start


This job will run another job. It is intended for starting services or jobs on remote servers which is why it is named start. If it used on a local job it will block until the local job has run.

Unlike the run, this job will not monitor or reflect the state of the started job. To monitor the state of the started job the job could be followed by a state:mirror.

The start job won't reset the job to be started. If the job to start isn't started because it's in the wrong state this job will still COMPLETE. This job can be preceded by a reset if resetting is required.


Property Summary

job The job to start
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 Starting a service.

Property Detail

job

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredYes.

The job to start

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

Starting a service. A folder contains a choice of services. The service id to use is provided at runtime with a property such as -DpriceService=nonCachingPriceService. The selected service is started and used by the Pricing Job.

<oddjob>
  <job>
    <sequential>
      <jobs>
        <folder name="services">
          <jobs>
            <bean id="cachingPriceService" class="org.oddjob.examples.CachingPriceService"/>
            <bean id="nonCachingPriceService" class="org.oddjob.examples.NonCachingPriceService"/>
          </jobs>
        </folder>
        <start job="${${priceService}}"/>
        <bean id="pricingJob" class="org.oddjob.examples.PricingJob" priceService="${${priceService}}"/>
      </jobs>
    </sequential>
  </job>
</oddjob>


(c) Rob Gordon 2005 - 2017