public class DataflowImpl extends AbstractAnnotatedThing<Dataflow> implements Dataflow
Modifier and Type | Field and Description |
---|---|
protected String |
internalIdentifier |
Modifier | Constructor and Description |
---|---|
protected |
DataflowImpl()
Protected constructor, assigns a default name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addInputPort(DataflowInputPortImpl inputPort)
Adds an input port to the DataFlow.
|
protected void |
addMerge(org.apache.taverna.workflowmodel.impl.MergeImpl merge)
Adds a processor on the DataFlow.
|
protected void |
addOutputPort(org.apache.taverna.workflowmodel.impl.DataflowOutputPortImpl outputPort)
Adds an output port to the DataFlow.
|
protected void |
addProcessor(ProcessorImpl processor)
Adds a processor on the DataFlow.
|
DataflowValidationReport |
checkValidity()
Run the type check algorithm and return a report on any problems found.
|
DataflowValidationReport |
checkValidityImpl()
Works out whether a dataflow is valid.
|
protected DataflowInputPort |
createInputPort(String name,
int depth,
int granularDepth)
Build a new dataflow input port, the granular depth is set for the input
port so it can be copied onto the internal output port
|
protected DataflowOutputPort |
createOutputPort(String name)
Create and return a new DataflowOutputPort in this dataflow
|
boolean |
doTypeCheck()
Run a collection level based type check on the token processing entity
|
void |
fire(String owningProcess,
InvocationContext context)
A dataflow with no inputs cannot be driven by the supply of data tokens
as it has nowhere to receive such tokens.
|
<T extends NamedWorkflowEntity> |
getEntities(Class<T> entityType)
Gets all workflow entities of the specified type and returns as an
unmodifiable list of that type
|
FailureTransmitter |
getFailureTransmitter()
The failure transmitter contains event listeners to be notified of
workflow level failures - these occur when an error bubbles up to the top
of the dispatch stack in a processor and is not handled by conversion to
an error token within the data stream.
|
String |
getIdentifier()
An identifier that is unique to this dataflow and its current state.
|
List<? extends DataflowInputPort> |
getInputPorts()
Return a copy of the list of dataflow input ports for this dataflow
|
List<? extends Datalink> |
getLinks()
For each processor input, merge input and workflow output get the
incoming link and, if non null, add to a list and return the entire list.
|
String |
getLocalName()
Return the local name of this workflow
|
List<? extends Merge> |
getMerges()
Return the list of all merge operations within the dataflow
|
List<? extends DataflowOutputPort> |
getOutputPorts()
Return all dataflow output ports
|
List<? extends Processor> |
getProcessors()
Return the list of all processors within the dataflow
|
boolean |
isInputPortConnected(DataflowInputPort inputPort)
Check if the given input port is connected to anything in the workflow.
|
protected Datalink |
link(String sourceName,
String sinkName)
Create a new datalink between two entities within the workflow
|
String |
recordIdentifier() |
void |
refreshInternalIdentifier() |
protected void |
removeDataflowInputPort(DataflowInputPort dip)
Remove the specified input port from this dataflow
|
protected void |
removeDataflowInputPort(String name)
Remove the named dataflow input port
|
protected void |
removeDataflowOutputPort(DataflowOutputPort dop)
Remove the specified output port from this dataflow
|
protected void |
removeDataflowOutputPort(String name)
Remove the named dataflow output port
|
protected void |
removeMerge(Merge merge) |
protected void |
removeProcessor(Processor processor) |
void |
setImmutable()
Mark this dataflow as immutable.
|
void |
setLocalName(String localName)
Sets the local name for the dataflow
|
protected boolean |
tokenReceived(String owningProcess,
InvocationContext context)
Called when a token is received or the dataflow is fired, checks to see
whether the process identifier is already known (in which case we assume
it's been registered and can ignore it) or registers it with the monitor
along with all child entities.
|
String |
toString() |
getAddAnnotationEdit, getAnnotations, getRemoveAnnotationEdit, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAddAnnotationEdit, getAnnotations, getRemoveAnnotationEdit, setAnnotations
protected String internalIdentifier
protected DataflowImpl()
protected void addProcessor(ProcessorImpl processor) throws NamingException
processor
- the ProcessorImpl to be added to the DataflowNamingException
- if a processor already exists with the same local nameprotected void removeProcessor(Processor processor)
protected void addMerge(org.apache.taverna.workflowmodel.impl.MergeImpl merge) throws NamingException
processor
- the ProcessorImpl to be added to the DataflowNamingException
- if a processor already exists with the same local nameprotected void removeMerge(Merge merge)
protected DataflowInputPort createInputPort(String name, int depth, int granularDepth) throws NamingException
name
- name of the dataflow input port to builddepth
- input depthgranularDepth
- granular depth to copy to the internal output portNamingException
- in the event of a duplicate or invalid nameprotected void addInputPort(DataflowInputPortImpl inputPort) throws EditException
inputPort
- the DataflowInputPortImpl to be added to the DataflowEditException
protected void removeDataflowInputPort(String name) throws EditException
name
- name of the dataflow input port to removeEditException
- if the specified port doesn't exist within this dataflowprotected void removeDataflowInputPort(DataflowInputPort dip) throws EditException
dip
- dataflow input port to removeEditException
- if the input port isn't in the list of inputs - should never
happen but you never know.protected DataflowOutputPort createOutputPort(String name) throws NamingException
name
- name of the port to create, must be unique within the set of
output ports for this dataflowNamingException
- if the name is invalid or already exists as a name for a
dataflow outputprotected void addOutputPort(org.apache.taverna.workflowmodel.impl.DataflowOutputPortImpl outputPort) throws EditException
outputPort
- the DataflowOutputPortImpl to be added to the DataflowEditException
protected void removeDataflowOutputPort(String name) throws EditException
name
- name of the dataflow output port to removeEditException
- if the specified port doesn't exist within this dataflowprotected void removeDataflowOutputPort(DataflowOutputPort dop) throws EditException
dop
- dataflow output port to removeEditException
- if the output port isn't in the list of outputs for this
dataflowprotected Datalink link(String sourceName, String sinkName) throws EditException
sourceName
- interpreted either as the literal name of a dataflow input
port or the colon seperated name of a
[processorName|mergeName]:[outputPort]sinkName
- as with sourceName but for processor or merge input ports and
dataflow output portsEditException
- if either source or sink isn't found within this dataflow or
if the link would violate workflow structural constraints in
an immediate way. This won't catch cycles (see the validation
methods for that) but will prevent you from having more than
one link going to an input port.public List<? extends DataflowInputPort> getInputPorts()
getInputPorts
in interface Dataflow
getInputPorts
in interface TokenProcessingEntity
public List<? extends Datalink> getLinks()
public List<? extends Processor> getProcessors()
getProcessors
in interface Dataflow
public List<? extends Merge> getMerges()
public List<? extends DataflowOutputPort> getOutputPorts()
getOutputPorts
in interface Dataflow
getOutputPorts
in interface TokenProcessingEntity
public String getLocalName()
getLocalName
in interface NamedWorkflowEntity
public DataflowValidationReport checkValidity()
setImmutable()
,
subsequent calls to this method will return the cached
DataflowValidationReport.checkValidity
in interface Dataflow
public DataflowValidationReport checkValidityImpl()
public <T extends NamedWorkflowEntity> List<? extends T> getEntities(Class<T> entityType)
getEntities
in interface Dataflow
entityType
- a class of the type specified by the type variable T. All
entities returned in the list can be cast to this typeprotected boolean tokenReceived(String owningProcess, InvocationContext context)
owningProcess
- public void setLocalName(String localName)
localName
- public void fire(String owningProcess, InvocationContext context)
Dataflow
public FailureTransmitter getFailureTransmitter()
Dataflow
Listeners are messaged after all clean-up has been performed on the dataflow's internal state and that of any child operations within it, guaranteeing that no tokens will be generated with the id of the failed process after the message has been received by the listener
getFailureTransmitter
in interface Dataflow
public boolean doTypeCheck() throws IterationTypeMismatchException
TokenProcessingEntity
doTypeCheck
in interface TokenProcessingEntity
IterationTypeMismatchException
- if the typing occurred but didn't match because of an
iteration mismatchpublic void refreshInternalIdentifier()
public String getIdentifier()
Dataflow
getIdentifier
in interface Dataflow
public String recordIdentifier()
recordIdentifier
in interface Dataflow
public boolean isInputPortConnected(DataflowInputPort inputPort)
Dataflow
isInputPortConnected
in interface Dataflow
public void setImmutable()
Dataflow
Dataflow.fire(String, InvocationContext)
, in order to guarantee that
datalinks, port depths etc. don't change while the dataflow is running.setImmutable
in interface Dataflow
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.