Class SimultaneousStructural

All Implemented Interfaces:
Serializable, Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resettable, Stateful, Stoppable, Structural
Direct Known Subclasses:
ParallelJob, StateReflector

public abstract class SimultaneousStructural extends StructuralJob<Object> implements Stoppable
An abstract base class for Structural jobs where all child jobs can run simultaneously.
Author:
rob
See Also:
  • Constructor Details

    • SimultaneousStructural

      public SimultaneousStructural()
      Create a new instance.
  • Method Details

    • setExecutorService

      @Inject public void setExecutorService(ExecutorService executorService)
      Parameters:
      executorService - The Executor Service.
      Reference Property:
      executorService

      Description

      The ExecutorService to use. This will be automatically set by Oddjob.
      Required:
      No.
    • getExecutorService

      public ExecutorService getExecutorService()
      Getter for executor service.
      Returns:
      The executor service or null if not set.
    • setJobs

      public void setJobs(int index, Object child)
      Add a child job.
      Parameters:
      child - A child
      Reference Property:
      jobs

      Description

      The child jobs.
      Required:
      No, but pointless if missing.
    • execute

      protected void execute() throws InterruptedException, ExecutionException
      Description copied from class: StructuralJob
      Execute this job.
      Specified by:
      execute in class StructuralJob<Object>
      Throws:
      InterruptedException
      ExecutionException
    • 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
    • startChildStateReflector

      protected void startChildStateReflector()
      Description copied from class: StructuralJob
      Start the child state reflector. Sub classes override this if they need to start the child state reflector at a different time.
      Overrides:
      startChildStateReflector in class StructuralJob<Object>
    • isJoin

      public boolean isJoin()
      Should execution wait for all jobs to be executed before returning to calling code.

      This property is intended to be overridden by sub classes that wish to give that choice to users.

      Returns:
      true for execution to wait for children. False for completion to be asynchronous.