Package org.vast.process
Class DataConnection
java.lang.Object
org.vast.process.DataConnection
- All Implemented Interfaces:
 IDataConnection
- Direct Known Subclasses:
 DataQueue
 Implementation of data connection for the processing engine.
 This class is capable of automatically converting units if source and target
 are not in the same unit (units have to be physically compatible)
 This class is used when running all processes of a processing chain
 synchronously in a single thread
 
- 
Nested Class Summary
Nested Classes - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<DataConnection.ComponentConverter>protected booleanprotected DataChoiceprotected intprotected DataComponentprotected IProcessExecprotected DataComponentprotected IProcessExec - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all remaining data on this connectiongetProperty(String propName) protected UnitConvertergetUnitConverter(DataComponent src, DataComponent dest) booleanvoidPublish data from source component on this connectionvoidsetDestination(IProcessExec process, DataComponent component) voidsetProperty(String propName, Object propValue) voidsetSource(IProcessExec process, DataComponent component) protected voidbooleantransferData(boolean block) Transfer data to destination componentstatic Stringvalidate(DataComponent src, DataComponent dest) Checks that source and destination components can be connected.protected static voidvalidateArray(DataArray srcComp, DataArray destComp, StringBuilder msg) protected static voidvalidateScalar(DataComponent srcComp, DataComponent destComp, StringBuilder msg)  
- 
Field Details
- 
sourceProcess
 - 
destinationProcess
 - 
sourceComponent
 - 
destinationComponent
 - 
destinationChoice
 - 
destinationChoiceIdx
protected int destinationChoiceIdx - 
dataAvailable
protected boolean dataAvailable - 
componentConverters
 - 
properties
 
 - 
 - 
Constructor Details
- 
DataConnection
public DataConnection() 
 - 
 - 
Method Details
- 
setupUnitConverters
protected void setupUnitConverters() - 
getUnitConverter
 - 
validate
Checks that source and destination components can be connected. This validates compatibility of units and structure of aggregates.- Parameters:
 src-dest-- Returns:
 - Warning message or null if no warning
 - Throws:
 ProcessException
 - 
validateArray
protected static void validateArray(DataArray srcComp, DataArray destComp, StringBuilder msg) throws ProcessException - Throws:
 ProcessException
 - 
validateScalar
protected static void validateScalar(DataComponent srcComp, DataComponent destComp, StringBuilder msg) throws ProcessException - Throws:
 ProcessException
 - 
publishData
Description copied from interface:IDataConnectionPublish data from source component on this connection- Specified by:
 publishDatain interfaceIDataConnection- Throws:
 InterruptedException- if interrupted while waiting
 - 
transferData
Description copied from interface:IDataConnectionTransfer data to destination component- Specified by:
 transferDatain interfaceIDataConnection- Parameters:
 block- Set to true if processing should wait until data is available on this connection, false if processing should continue without it- Returns:
 - True if data was actually transferred, false otherwise
 - Throws:
 InterruptedException- if interrupted while waiting
 - 
setSource
- Specified by:
 setSourcein interfaceIDataConnection
 - 
getSourceProcess
- Specified by:
 getSourceProcessin interfaceIDataConnection
 - 
getSourcePort
- Specified by:
 getSourcePortin interfaceIDataConnection
 - 
getSourceComponent
- Specified by:
 getSourceComponentin interfaceIDataConnection
 - 
setDestination
- Specified by:
 setDestinationin interfaceIDataConnection
 - 
getDestinationProcess
- Specified by:
 getDestinationProcessin interfaceIDataConnection
 - 
getDestinationPort
- Specified by:
 getDestinationPortin interfaceIDataConnection
 - 
getDestinationComponent
- Specified by:
 getDestinationComponentin interfaceIDataConnection
 - 
isDataAvailable
public boolean isDataAvailable()- Specified by:
 isDataAvailablein interfaceIDataConnection- Returns:
 - true if data is available (i.e. ready to be transfered) on this connection
 
 - 
clear
public void clear()Description copied from interface:IDataConnectionClear all remaining data on this connection- Specified by:
 clearin interfaceIDataConnection
 - 
getProperty
 - 
setProperty
 
 -