public abstract class DispatchStackImpl extends AbstractAnnotatedThing<DispatchStack> implements DispatchStack
Modifier and Type | Class and Description |
---|---|
protected class |
DispatchStackImpl.TopLayer |
Constructor and Description |
---|
DispatchStackImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addLayer(DispatchLayer<?> newLayer) |
void |
addLayer(DispatchLayer<?> newLayer,
int index) |
protected abstract boolean |
conditionsSatisfied(String owningProcess)
Called to determine whether all the preconditions for this dispatch stack
are satisfied.
|
protected abstract void |
finishedWith(String owningProcess)
Called when the specified owning process is finished with, that is to say
all invocation has been performed and any layer state caches have been
purged.
|
protected DispatchLayer<?> |
firstLayer() |
protected abstract List<? extends Activity<?>> |
getActivities()
Override to return the list of activities to be used by this dispatch
stack.
|
List<DispatchLayer<?>> |
getLayers()
The DispatchStack consists of an ordered list of DispatchLayer instances
where the DispatchLayer at index zero is at the bottom of the stack and
is almost always an invocation layer of some kind (in any working
dispatch stack configuration)
|
protected abstract String |
getProcessName()
Defines the enclosing process name, usually Processor.getName() on the
parent
|
DispatchLayer<?> |
layerAbove(DispatchLayer<?> layer)
Return the layer above (lower index!) the specified layer, or a reference
to the internal top layer dispatch layer if there is no layer above the
specified one.
|
DispatchLayer<?> |
layerBelow(DispatchLayer<?> layer)
Return the layer below (higher index) the specified layer, or null if
there are no layers below this one
|
protected abstract void |
pushEvent(IterationInternalEvent<? extends IterationInternalEvent<?>> e)
Called when an event (Completion or Job) hits the top of the dispatch
stack and needs to be pushed out of the processor
|
void |
receiveEvent(IterationInternalEvent event)
Receive an event to be fed into the top layer of the dispatch stack for
processing.
|
int |
removeLayer(DispatchLayer<?> layer) |
void |
satisfyConditions(String enclosingProcess)
Called when a set of conditions which were unsatisfied in the context of
a given owning process become satisfied.
|
getAddAnnotationEdit, getAnnotations, getRemoveAnnotationEdit, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getProcessor, receiveMonitorableProperty
getAddAnnotationEdit, getAnnotations, getRemoveAnnotationEdit, setAnnotations
protected abstract List<? extends Activity<?>> getActivities()
protected abstract void pushEvent(IterationInternalEvent<? extends IterationInternalEvent<?>> e)
e
- protected abstract boolean conditionsSatisfied(String owningProcess)
owningProcess
- protected abstract void finishedWith(String owningProcess)
owningProcess
- protected abstract String getProcessName()
public void receiveEvent(IterationInternalEvent event)
Because the condition checking logic must check against the enclosing process any attempt to call this method with an owning process without a colon in will fail with an index array out of bounds error. All owning process identifiers must resemble 'enclosingProcess:processorName' at the minimum.
event
- public void satisfyConditions(String enclosingProcess)
owningProcess
- public List<DispatchLayer<?>> getLayers()
DispatchStack
getLayers
in interface DispatchStack
public void addLayer(DispatchLayer<?> newLayer)
public void addLayer(DispatchLayer<?> newLayer, int index)
public int removeLayer(DispatchLayer<?> layer)
public DispatchLayer<?> layerAbove(DispatchLayer<?> layer)
The top layer within the dispatch stack is always invisible and is held within the DispatchStackImpl object itself, being used to route data out of the entire stack
layerAbove
in interface DispatchStack
layer
- public DispatchLayer<?> layerBelow(DispatchLayer<?> layer)
layerBelow
in interface DispatchStack
protected DispatchLayer<?> firstLayer()
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.