Package org.oddjob.framework.extend
Class SimultaneousStructural
java.lang.Object
org.oddjob.framework.extend.BaseComponent
org.oddjob.framework.extend.BasePrimary
org.oddjob.framework.extend.StructuralJob<Object>
org.oddjob.framework.extend.SimultaneousStructural
- All Implemented Interfaces:
Serializable,Runnable,ArooaContextAware,ArooaSessionAware,Forceable,PropertyChangeNotifier,Iconic,LogEnabled,Resettable,Stateful,Stoppable,Structural
- Direct Known Subclasses:
ParallelJob,StateReflector
An abstract base class for Structural jobs where all child jobs
can run simultaneously.
- Author:
- rob
- See Also:
-
Field Summary
Fields inherited from class org.oddjob.framework.extend.StructuralJob
childHelper, destroy, stop, structuralState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute()Execute this job.Getter for executor service.booleanisJoin()Should execution wait for all jobs to be executed before returning to calling code.protected voidonStop()Allow sub classes to do something on stop.voidsetExecutorService(ExecutorService executorService) Set theExecutorService.voidAdd a child job.protected voidStart the child state reflector.Methods inherited from class org.oddjob.framework.extend.StructuralJob
addStructuralListener, fireDestroyedState, force, getInitialStateOp, getStateChanger, hardReset, iconHelper, isStop, onDestroy, onHardReset, onReset, onSoftReset, postStop, removeStructuralListener, run, softReset, stateHandler, stop, stopChildStateReflector, waitForChildrenOnStopMethods inherited from class org.oddjob.framework.extend.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toStringMethods inherited from class org.oddjob.framework.extend.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaContext, setArooaSessionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
-
Constructor Details
-
SimultaneousStructural
public SimultaneousStructural()Create a new instance.
-
-
Method Details
-
setExecutorService
Set theExecutorService.- Parameters:
executorService- The Executor Service.- Reference Property:
- executorService
- Required:
- No.
Description
The ExecutorService to use. This will be automatically set by Oddjob. -
getExecutorService
Getter for executor service.- Returns:
- The executor service or null if not set.
-
setJobs
Add a child job.- Parameters:
child- A child- Reference Property:
- jobs
- Required:
- No, but pointless if missing.
Description
The child jobs. -
execute
Description copied from class:StructuralJobExecute this job.- Specified by:
executein classStructuralJob<Object>- Throws:
InterruptedExceptionExecutionException
-
onStop
Description copied from class:StructuralJobAllow sub classes to do something on stop.- Overrides:
onStopin classStructuralJob<Object>- Throws:
FailedToStopException
-
startChildStateReflector
protected void startChildStateReflector()Description copied from class:StructuralJobStart the child state reflector. Sub classes override this if they need to start the child state reflector at a different time.- Overrides:
startChildStateReflectorin classStructuralJob<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.
-