@DispatchLayerErrorReaction(emits={}, relaysUnmodified=true, stateEffects={REMOVE_PROCESS_STATE,NO_EFFECT}) @DispatchLayerJobQueueReaction(emits=JOB, relaysUnmodified=false, stateEffects=CREATE_PROCESS_STATE) @DispatchLayerResultReaction(emits={}, relaysUnmodified=true, stateEffects={REMOVE_PROCESS_STATE,NO_EFFECT}) @DispatchLayerResultCompletionReaction(emits={}, relaysUnmodified=true, stateEffects={REMOVE_PROCESS_STATE,NO_EFFECT}) @SupportsStreamedResult public class Parallelize extends AbstractDispatchLayer<com.fasterxml.jackson.databind.JsonNode> implements NotifiableLayer, PropertyContributingDispatchLayer<com.fasterxml.jackson.databind.JsonNode>
Modifier and Type | Field and Description |
---|---|
static String |
URI |
CLEANUP_DELAY_MS, cleanupTimer, dispatchStack
Constructor and Description |
---|
Parallelize() |
Parallelize(int maxJobs)
Test constructor, only used by unit tests, should probably not be public
access here?
|
Modifier and Type | Method and Description |
---|---|
void |
configure(com.fasterxml.jackson.databind.JsonNode config)
When the item is built from the workflow definition XML the object is
first constructed with a default constructor then this method is called,
passing in the configuration bean returned by getConfiguration().
|
void |
eventAdded(String owningProcess)
Called when a new
Job or Completion is added to a queue
within the dispatch stack |
void |
finishedWith(String owningProcess)
Called when there will be no more events with the specified process
identifier, can be used to purge cached state from layers within the
stack
|
com.fasterxml.jackson.databind.JsonNode |
getConfiguration()
Each item stores configuration within a bean of type ConfigurationType,
this method returns the configuration.
|
void |
injectPropertiesFor(String owningProcess)
Injects the following properties into its parent processor's property set:
dispatch.parallelize.queuesize [Integer] The current size of the incomming job queue, or -1 if the state isn't defined for the registered process identifier (which will be the case if the process hasn't started or has had its state purged after a final completion of some kind. |
void |
receiveError(DispatchErrorEvent errorEvent)
Receive a single error reference from the layer below
|
void |
receiveJob(Job job,
List<? extends Activity<?>> activities) |
void |
receiveJobQueue(DispatchJobQueueEvent queueEvent)
Receive a pointer to the job queue along with a set of activities, this
is received from the layer above in the dispatch stack or from the
DispatchStackImpl object itself if this is the top layer.
|
void |
receiveResult(DispatchResultEvent resultEvent)
Receive a result from the layer below
|
void |
receiveResultCompletion(DispatchCompletionEvent completionEvent)
Only going to receive this if the activity invocation was streaming, in
which case we need to handle all completion events and pass them up the
stack.
|
getAbove, getBelow, getProcessor, receiveJob, setDispatchStack
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
receiveJob, setDispatchStack
public static final String URI
public Parallelize()
public Parallelize(int maxJobs)
maxJobs
- public void eventAdded(String owningProcess)
NotifiableLayer
Job
or Completion
is added to a queue
within the dispatch stackeventAdded
in interface NotifiableLayer
public void receiveJobQueue(DispatchJobQueueEvent queueEvent)
DispatchLayer
receiveJobQueue
in interface DispatchLayer<com.fasterxml.jackson.databind.JsonNode>
receiveJobQueue
in class AbstractDispatchLayer<com.fasterxml.jackson.databind.JsonNode>
public void receiveError(DispatchErrorEvent errorEvent)
DispatchLayer
receiveError
in interface DispatchLayer<com.fasterxml.jackson.databind.JsonNode>
receiveError
in class AbstractDispatchLayer<com.fasterxml.jackson.databind.JsonNode>
public void receiveResult(DispatchResultEvent resultEvent)
DispatchLayer
receiveResult
in interface DispatchLayer<com.fasterxml.jackson.databind.JsonNode>
receiveResult
in class AbstractDispatchLayer<com.fasterxml.jackson.databind.JsonNode>
public void receiveResultCompletion(DispatchCompletionEvent completionEvent)
receiveResultCompletion
in interface DispatchLayer<com.fasterxml.jackson.databind.JsonNode>
receiveResultCompletion
in class AbstractDispatchLayer<com.fasterxml.jackson.databind.JsonNode>
public void finishedWith(String owningProcess)
DispatchLayer
finishedWith
in interface DispatchLayer<com.fasterxml.jackson.databind.JsonNode>
finishedWith
in class AbstractDispatchLayer<com.fasterxml.jackson.databind.JsonNode>
public void configure(com.fasterxml.jackson.databind.JsonNode config)
Configurable
configure
in interface Configurable<com.fasterxml.jackson.databind.JsonNode>
public com.fasterxml.jackson.databind.JsonNode getConfiguration()
Configurable
getConfiguration
in interface Configurable<com.fasterxml.jackson.databind.JsonNode>
public void injectPropertiesFor(String owningProcess)
dispatch.parallelize.queuesize [Integer]
injectPropertiesFor
in interface PropertyContributingDispatchLayer<com.fasterxml.jackson.databind.JsonNode>
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.