public abstract class AbstractProcessImpl extends DescribedObjectImpl implements AbstractProcess, IProcessExec, Runnable
This class implements both AbstractProcess from SensorML v2.0 bindings
and IProcessExec to allow execution if an executable implementation is
provided.
In order to provide execution capabilitiy, this class can wrap an
implementation of IProcessExec corresponding to a particular algorithm.
Modifier and Type | Field and Description |
---|---|
protected AbstractSettings |
configuration |
protected String |
definition |
protected IProcessExec |
executableProcess |
protected FeatureList |
featuresOfInterest |
protected IOPropertyList |
inputData |
protected List<AbstractModes> |
modesList |
protected IOPropertyList |
outputData |
protected IOPropertyList |
paramData |
protected Reference |
typeOf |
capabilitiesList, characteristicsList, classificationList, contactsList, documentationList, extensionList, historyList, identificationList, keywordsList, lang, legalConstraintsList, securityConstraintsList, validTimeList
boundedBy, location, qName
description, descriptionReference, id, identifier, metaDataPropertyList, nameList, UUID_CODE
DEFAULT_NS_URI
Constructor and Description |
---|
AbstractProcessImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addInput(String name,
DataComponent input)
Adds a new inputAsAbstractDataComponent property
|
void |
addInput(String name,
DataInterface input)
Adds a new inputAsDataInterface property
|
void |
addInput(String name,
ObservableProperty input)
Adds a new inputAsObservableProperty property
|
void |
addModes(AbstractModes modes)
Adds a new modes property
|
void |
addOutput(String name,
DataComponent output)
Adds a new outputAsAbstractDataComponent property
|
void |
addOutput(String name,
DataInterface output)
Adds a new outputAsDataInterface property
|
void |
addOutput(String name,
ObservableProperty output)
Adds a new outputAsObservableProperty property
|
void |
addParameter(String name,
DataComponent parameter)
Adds a new parameterAsAbstractDataComponent property
|
void |
addParameter(String name,
DataInterface parameter)
Adds a new parameterAsDataInterface property
|
void |
addParameter(String name,
ObservableProperty parameter)
Adds a new parameterAsObservableProperty property
|
boolean |
canRun()
Check that all needed connections are ready for the process
to run in sync mode (not threaded).
|
protected void |
checkExecutable() |
void |
connectInput(String inputName,
String dataPath,
DataConnection connection)
Connects one of this process inputs with the given connection
|
void |
connectOutput(String outputName,
String dataPath,
DataConnection connection)
Connects one of this process outputs with the given connection
|
void |
connectParameter(String paramName,
String dataPath,
DataConnection connection)
Connects one of this process parameters with the given connection
|
void |
createNewInputBlocks()
Creates new DataBlock for each input signal
|
void |
createNewOutputBlocks()
Creates new DataBlock for each output signal
|
void |
dispose()
Override to dispose of all resources allocated
for the process (stop threads, OS resources, etc...)
Default method does nothing.
|
void |
execute()
Execute is typically called several times on a process and should
contain all the logic to transform input/parameter values to
output values.
|
AbstractSettings |
getConfiguration()
Gets the configuration property
|
String |
getDefinition()
Gets the definition property
|
FeatureList |
getFeaturesOfInterest()
Gets the featuresOfInterest property
|
AbstractSWEIdentifiable |
getInput(String name)
Gets the input property with the given name
|
DataComponent |
getInputComponent(String name)
Gets the data structure of the input with the given name
|
List<DataConnectionList> |
getInputConnections() |
IOPropertyList |
getInputList()
Gets the list of input properties
|
List<AbstractModes> |
getModesList()
Gets the list of modes properties
|
int |
getNumInputs()
Returns number of input properties
|
int |
getNumModes()
Returns number of modes properties
|
int |
getNumOutputs()
Returns number of output properties
|
int |
getNumParameters()
Returns number of parameter properties
|
AbstractSWEIdentifiable |
getOutput(String name)
Gets the output property with the given name
|
DataComponent |
getOutputComponent(String name)
Gets the data structure of the output with the given name
|
List<DataConnectionList> |
getOutputConnections() |
IOPropertyList |
getOutputList()
Gets the list of output properties
|
List<DataConnectionList> |
getParamConnections() |
AbstractSWEIdentifiable |
getParameter(String name)
Gets the parameter property with the given name
|
DataComponent |
getParameterComponent(String name)
Gets the data structure of the parameter with the given name
|
IOPropertyList |
getParameterList()
Gets the list of parameter properties
|
protected int |
getSignalIndex(OgcPropertyList<?> ioList,
String signalName) |
Reference |
getTypeOf()
Gets the typeOf property
|
void |
init()
Initialize the process and its internal variables (fixed parameters).
|
boolean |
isExecutable()
Checks if the process is executable
|
boolean |
isInputConnected(String inputName)
Checks if the specified input has one or more connections
|
boolean |
isOutputConnected(String outputName)
Checks if the specified output has one or more connections
|
boolean |
isParamConnected(String paramName)
Checks if the specified parameter has one or more connections
|
boolean |
isSetConfiguration()
Checks if configuration is set
|
boolean |
isSetDefinition()
Checks if definition is set
|
boolean |
isSetFeaturesOfInterest()
Checks if featuresOfInterest is set
|
boolean |
isSetTypeOf()
Checks if typeOf is set
|
boolean |
isUsingQueueBuffers()
Checks if actual buffered queues are used to connect with this process
|
boolean |
needSync() |
void |
reset()
Resets the process (especially asnchronous ones) before it can be run again.
|
void |
run()
Process thread run method
|
void |
setAvailability(List<DataConnectionList> allConnections,
boolean availability) |
void |
setConfiguration(AbstractSettings configuration)
Sets the configuration property
|
void |
setDefinition(String definition)
Sets the definition property
|
void |
setExecutableImpl(ExecutableProcessImpl processExec) |
void |
setFeaturesOfInterest(FeatureList featuresOfInterest)
Sets the featuresOfInterest property
|
void |
setTypeOf(Reference typeOf)
Sets the typeOf property
|
void |
setUsingQueueBuffers(boolean usingQueueBuffers) |
void |
start()
Start process thread
|
void |
stop()
Stop process thread gracefully
|
String |
toString()
Print process name and I/O info
|
void |
transferData(List<DataConnectionList> allConnections) |
addCapabilities, addCharacteristics, addClassification, addContacts, addDocumentation, addExtension, addHistory, addIdentification, addKeywords, addLegalConstraints, addSecurityConstraints, addValidTimeAsTimeInstant, addValidTimeAsTimePeriod, getCapabilities, getCapabilitiesList, getCharacteristics, getCharacteristicsList, getClassificationList, getContactsList, getDocumentationList, getExtensionList, getHistoryList, getIdentificationList, getKeywordsList, getLang, getLegalConstraintsList, getNumCapabilities, getNumCharacteristics, getNumClassifications, getNumContacts, getNumDocumentations, getNumExtensions, getNumHistorys, getNumIdentifications, getNumKeywords, getNumLegalConstraints, getNumSecurityConstraints, getNumValidTimes, getSecurityConstraintsList, getValidTimeList, isSetLang, setLang
equals, getBoundedBy, getLocation, getLocationProperty, getQName, hashCode, isSetBoundedBy, isSetLocation, setBoundedByAsEnvelope, setLocation
addName, getDescription, getDescriptionReference, getId, getIdentifier, getMetaDataPropertyList, getName, getNameList, getNumNames, getUniqueIdentifier, isSetDescription, isSetDescriptionReference, isSetIdentifier, setDescription, setDescriptionReference, setId, setIdentifier, setName, setUniqueIdentifier
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addCapabilities, addCharacteristics, addClassification, addContacts, addDocumentation, addExtension, addHistory, addIdentification, addKeywords, addLegalConstraints, addSecurityConstraints, addValidTimeAsTimeInstant, addValidTimeAsTimePeriod, getCapabilities, getCapabilitiesList, getCharacteristics, getCharacteristicsList, getClassificationList, getContactsList, getDocumentationList, getExtensionList, getHistoryList, getIdentificationList, getKeywordsList, getLang, getLegalConstraintsList, getNumCapabilities, getNumCharacteristics, getNumClassifications, getNumContacts, getNumDocumentations, getNumExtensions, getNumHistorys, getNumIdentifications, getNumKeywords, getNumLegalConstraints, getNumSecurityConstraints, getNumValidTimes, getSecurityConstraintsList, getValidTimeList, isSetLang, setLang
getBoundedBy, getLocation, getLocationProperty, getQName, isSetBoundedBy, isSetLocation, setBoundedByAsEnvelope, setLocation
addName, getDescription, getDescriptionReference, getId, getIdentifier, getMetaDataPropertyList, getName, getNameList, getNumNames, getUniqueIdentifier, isSetDescription, isSetDescriptionReference, isSetIdentifier, setDescription, setDescriptionReference, setId, setIdentifier, setName, setUniqueIdentifier
getName
protected Reference typeOf
protected AbstractSettings configuration
protected FeatureList featuresOfInterest
protected IOPropertyList inputData
protected IOPropertyList outputData
protected IOPropertyList paramData
protected List<AbstractModes> modesList
protected String definition
protected transient IProcessExec executableProcess
public void setExecutableImpl(ExecutableProcessImpl processExec) throws SMLException
SMLException
public boolean isExecutable()
AbstractProcess
isExecutable
in interface AbstractProcess
protected final void checkExecutable() throws SMLException
SMLException
public void init() throws SMLException
IProcessExec
init
in interface IProcessExec
SMLException
public void reset() throws SMLException
IProcessExec
reset
in interface IProcessExec
SMLException
public void execute() throws SMLException
IProcessExec
execute
in interface IProcessExec
SMLException
public void dispose()
IProcessExec
dispose
in interface IProcessExec
public boolean canRun()
IProcessExec
canRun
in interface IProcessExec
public void createNewOutputBlocks()
IProcessExec
createNewOutputBlocks
in interface IProcessExec
public void createNewInputBlocks()
IProcessExec
createNewInputBlocks
in interface IProcessExec
public void run()
IProcessExec
run
in interface Runnable
run
in interface IProcessExec
public void start() throws SMLException
IProcessExec
start
in interface IProcessExec
SMLException
public void stop()
IProcessExec
stop
in interface IProcessExec
public String toString()
public void connectInput(String inputName, String dataPath, DataConnection connection) throws SMLException
IProcessExec
connectInput
in interface IProcessExec
inputName
- name of input to connectdataPath
- path of component to connectconnection
- connection object whose destination will be set to the specified componentSMLException
public void connectOutput(String outputName, String dataPath, DataConnection connection) throws SMLException
IProcessExec
connectOutput
in interface IProcessExec
outputName
- name of output to connectdataPath
- path of component to connectconnection
- connection object whose source will be set to the specified componentSMLException
public void connectParameter(String paramName, String dataPath, DataConnection connection) throws SMLException
IProcessExec
connectParameter
in interface IProcessExec
paramName
- name of parameter to connectdataPath
- path of component to connectconnection
- connection object whose destination will be set to the specified componentSMLException
public boolean isInputConnected(String inputName)
IProcessExec
isInputConnected
in interface IProcessExec
inputName
- name of inputpublic boolean isOutputConnected(String outputName)
IProcessExec
isOutputConnected
in interface IProcessExec
outputName
- name of outputpublic boolean isParamConnected(String paramName)
IProcessExec
isParamConnected
in interface IProcessExec
paramName
- name of parameterpublic List<DataConnectionList> getInputConnections()
getInputConnections
in interface IProcessExec
public List<DataConnectionList> getParamConnections()
getParamConnections
in interface IProcessExec
public List<DataConnectionList> getOutputConnections()
getOutputConnections
in interface IProcessExec
public boolean isUsingQueueBuffers()
IProcessExec
isUsingQueueBuffers
in interface IProcessExec
public void setUsingQueueBuffers(boolean usingQueueBuffers)
setUsingQueueBuffers
in interface IProcessExec
public boolean needSync()
needSync
in interface IProcessExec
public void setAvailability(List<DataConnectionList> allConnections, boolean availability)
setAvailability
in interface IProcessExec
public void transferData(List<DataConnectionList> allConnections)
transferData
in interface IProcessExec
protected int getSignalIndex(OgcPropertyList<?> ioList, String signalName)
public Reference getTypeOf()
getTypeOf
in interface AbstractProcess
public boolean isSetTypeOf()
isSetTypeOf
in interface AbstractProcess
public void setTypeOf(Reference typeOf)
setTypeOf
in interface AbstractProcess
public AbstractSettings getConfiguration()
getConfiguration
in interface AbstractProcess
public boolean isSetConfiguration()
isSetConfiguration
in interface AbstractProcess
public void setConfiguration(AbstractSettings configuration)
setConfiguration
in interface AbstractProcess
public FeatureList getFeaturesOfInterest()
getFeaturesOfInterest
in interface AbstractProcess
public boolean isSetFeaturesOfInterest()
isSetFeaturesOfInterest
in interface AbstractProcess
public void setFeaturesOfInterest(FeatureList featuresOfInterest)
setFeaturesOfInterest
in interface AbstractProcess
public IOPropertyList getInputList()
AbstractProcess
getInputList
in interface AbstractProcess
getInputList
in interface IProcessExec
public int getNumInputs()
AbstractProcess
getNumInputs
in interface AbstractProcess
public AbstractSWEIdentifiable getInput(String name)
AbstractProcess
getInput
in interface AbstractProcess
public DataComponent getInputComponent(String name)
AbstractProcess
getInputComponent
in interface AbstractProcess
public void addInput(String name, DataComponent input)
AbstractProcess
addInput
in interface AbstractProcess
public void addInput(String name, ObservableProperty input)
AbstractProcess
addInput
in interface AbstractProcess
public void addInput(String name, DataInterface input)
AbstractProcess
addInput
in interface AbstractProcess
public IOPropertyList getOutputList()
AbstractProcess
getOutputList
in interface AbstractProcess
getOutputList
in interface IProcessExec
public int getNumOutputs()
AbstractProcess
getNumOutputs
in interface AbstractProcess
public AbstractSWEIdentifiable getOutput(String name)
AbstractProcess
getOutput
in interface AbstractProcess
public DataComponent getOutputComponent(String name)
AbstractProcess
getOutputComponent
in interface AbstractProcess
public void addOutput(String name, DataComponent output)
AbstractProcess
addOutput
in interface AbstractProcess
public void addOutput(String name, ObservableProperty output)
AbstractProcess
addOutput
in interface AbstractProcess
public void addOutput(String name, DataInterface output)
AbstractProcess
addOutput
in interface AbstractProcess
public int getNumParameters()
AbstractProcess
getNumParameters
in interface AbstractProcess
public AbstractSWEIdentifiable getParameter(String name)
AbstractProcess
getParameter
in interface AbstractProcess
public DataComponent getParameterComponent(String name)
AbstractProcess
getParameterComponent
in interface AbstractProcess
public void addParameter(String name, DataComponent parameter)
AbstractProcess
addParameter
in interface AbstractProcess
public void addParameter(String name, ObservableProperty parameter)
AbstractProcess
addParameter
in interface AbstractProcess
public void addParameter(String name, DataInterface parameter)
AbstractProcess
addParameter
in interface AbstractProcess
public IOPropertyList getParameterList()
AbstractProcess
getParameterList
in interface AbstractProcess
getParameterList
in interface IProcessExec
public List<AbstractModes> getModesList()
getModesList
in interface AbstractProcess
public int getNumModes()
getNumModes
in interface AbstractProcess
public void addModes(AbstractModes modes)
addModes
in interface AbstractProcess
public String getDefinition()
getDefinition
in interface AbstractProcess
public boolean isSetDefinition()
isSetDefinition
in interface AbstractProcess
public void setDefinition(String definition)
setDefinition
in interface AbstractProcess
Copyright © 2016 Sensia Software LLC. All rights reserved.