org.oddjob.framework
Class SimultaneousStructural

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.BasePrimary
          extended by org.oddjob.framework.StructuralJob<Object>
              extended by org.oddjob.framework.SimultaneousStructural
All Implemented Interfaces:
Serializable, Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, 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.

See Also:
Serialized Form
Author:
rob

Field Summary
 
Fields inherited from class org.oddjob.framework.StructuralJob
childHelper, childStateReflector, stateHandler, stop, structuralState
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
SimultaneousStructural()
           
 
Method Summary
protected  void execute()
          Execute this job.
 boolean isJoin()
           
protected  void onStop()
          Allow sub classes to do something on stop.
 void setExecutorService(ExecutorService executorService)
          Set the ExecutorService.
 void setJobs(int index, Object child)
          Add a child job.
protected  void startChildStateReflector()
           
 
Methods inherited from class org.oddjob.framework.StructuralJob
addStructuralListener, fireDestroyedState, force, getInitialStateOp, getStateChanger, hardReset, isStop, onDestroy, onReset, removeStructuralListener, run, softReset, stateHandler, stop
 
Methods inherited from class org.oddjob.framework.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toString
 
Methods inherited from class org.oddjob.framework.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.oddjob.Stoppable
stop
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 

Constructor Detail

SimultaneousStructural

public SimultaneousStructural()
Method Detail

setExecutorService

@Inject
public void setExecutorService(ExecutorService executorService)
Set the ExecutorService.

Property: executorService

Description: The ExecutorService to use. This will be automatically set by Oddjob.

Required: No.

Parameters:
child - A child

setJobs

public void setJobs(int index,
                    Object child)
Add a child job.

Property: jobs

Description: The child jobs.

Required: No, but pointless if missing.

Parameters:
child - A child

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()
Overrides:
startChildStateReflector in class StructuralJob<Object>

isJoin

public boolean isJoin()