Class WaitJob

All Implemented Interfaces:
Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resettable, Stateful, Stoppable

public class WaitJob extends SimpleJob implements Stoppable
Author:
Rob Gordon

Description

This Job will either wait a given number of milliseconds or will wait for a property or job to become available.

If the for property is provided, then the delay is used as the number of milliseconds between checking if the property is available.

Example

The ExecutorThrottleType has a simple example.This example waits for a variable 'text' to be set. The value could be set across the network or by a another job running in parallel.
<sequential name="Waiting For a Property">

    <jobs>

        <variables id="waitvars"/>

        <wait name="Wait for Variable" for="${waitvars.text}" pause="2000"/>

        <echo name="Echo Text">${waitvars.text}</echo>

    </jobs>

</sequential>
  • Constructor Details

    • WaitJob

      public WaitJob()
  • Method Details

    • setPause

      public void setPause(long delay)
      Set the delay time in milli seconds.
      Parameters:
      delay - The delay time.
    • getPause

      public long getPause()
      Get the delay time in milli seconds.
      Returns:
      The delay time.
    • execute

      public 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.
    • simpleWait

      protected void simpleWait()
    • waitFor

      protected void waitFor()
    • waitForState

      protected void waitForState()
    • getFor

      public Object getFor()
    • setFor

      public void setFor(Object forProperty)
    • getState

      public StateCondition getState()
    • setState

      public void setState(StateCondition state)