Class RunJob

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

public class RunJob extends StructuralJob<Object> implements Structural, Stoppable
Author:
Rob Gordon
See Also:

Description

A job which runs another job. The other job can be local or on a server.

This job reflects the state of the job being executed.

Example

Examples elsewhere.
  • The JMXClientJob job has an example that uses run to run a job on a remote server.
  • Constructor Details

    • RunJob

      public RunJob()
  • Method Details

    • setJob

      public void setJob(Object node)
      Set the stop node directly.
      Parameters:
      node - The job.
    • getJob

      public Object getJob()
      Get the job.
      Returns:
      The node.
    • setStateOperator

      public void setStateOperator(StateOperator stateOperator)
      Parameters:
      stateOperator - The state operator to be applied to children's states to derive our state.
      Reference Property:
      stateOperator

      Description

      Set the way the children's state is evaluated and reflected by the parent. Values can be WORST, ACTIVE, or SERVICES.
      Required:
      No, default is ACTIVE.
    • getStateOperator

      public StateOperator getStateOperator()
      Getter for State Operator.
      Returns:
    • getInitialStateOp

      protected StateOperator getInitialStateOp()
      Description copied from class: StructuralJob
      Subclasses must provide the StateOperator that will decide how to evaluate the children's state.
      Specified by:
      getInitialStateOp in class StructuralJob<Object>
      Returns:
      A State Operator. Must not be null.
    • execute

      protected void execute() throws Exception
      Description copied from class: StructuralJob
      Execute this job.
      Specified by:
      execute in class StructuralJob<Object>
      Throws:
      Exception - If the unexpected occurs.
    • softReset

      public boolean softReset()
      Perform a soft reset on the job.
      Specified by:
      softReset in interface Resettable
      Overrides:
      softReset in class StructuralJob<Object>
      Returns:
      true if successful.
    • hardReset

      public boolean hardReset()
      Perform a hard reset on the job.
      Specified by:
      hardReset in interface Resettable
      Overrides:
      hardReset in class StructuralJob<Object>
      Returns:
      true if successful.
    • onStop

      protected void onStop() throws FailedToStopException
      Description copied from class: StructuralJob
      Allow sub classes to do something on stop.
      Overrides:
      onStop in class StructuralJob<Object>
      Throws:
      FailedToStopException
    • addStructuralListener

      public void addStructuralListener(StructuralListener listener)
      Description copied from class: StructuralJob
      Add a listener. The listener will immediately receive add notifications for all existing children.
      Specified by:
      addStructuralListener in interface Structural
      Overrides:
      addStructuralListener in class StructuralJob<Object>
      Parameters:
      listener - The listener.
    • getReset

      public ResetAction getReset()
    • setReset

      public void setReset(ResetAction reset)
    • setJoin

      public void setJoin(boolean join)
    • isJoin

      public boolean isJoin()
    • setShowJob

      public void setShowJob(boolean showJob)
    • isShowJob

      public boolean isShowJob()