public class DataQueue extends DataConnection
A data queue is used to send data between processes. It is synchronized to support processes in different threads, even on different computers (grid computing). Each element in the queue is called a data block. The queue can also send status values and events.
DataConnection.ComponentConverter
Modifier and Type | Field and Description |
---|---|
protected int |
counter |
protected LinkedList<DataBlock> |
queue |
boolean |
repeat |
int |
waitCount |
componentConverters, dataAvailable, destinationComponent, destinationProcess, needsUnitConversion, properties, sourceComponent, sourceProcess
Constructor and Description |
---|
DataQueue() |
Modifier and Type | Method and Description |
---|---|
void |
add(DataBlock data)
Adds DataBlock at the end of the list
|
void |
clear()
Clear all data bocks in the queue
|
DataBlock |
get()
Default version of previous method with timeout set to 0
This will make us wait until a new value arrives on the queue
|
DataBlock |
get(long timeout)
Gets the first DataBlock from the queue
|
boolean |
isDataAvailable() |
String |
toString() |
check, check, getDestinationComponent, getDestinationProcess, getProperty, getSourceComponent, getSourceProcess, getUnitConverter, setDataAvailable, setDestinationComponent, setDestinationProcess, setProperty, setSourceComponent, setSourceProcess, setupUnitConverters, transferDataBlocks
public int waitCount
public boolean repeat
protected LinkedList<DataBlock> queue
protected int counter
public void add(DataBlock data)
data
- public DataBlock get(long timeout) throws InterruptedException
timeout
- maximum time to wait until data is available, in msInterruptedException
public DataBlock get() throws InterruptedException
InterruptedException
public boolean isDataAvailable()
isDataAvailable
in class DataConnection
public void clear()
Copyright © 2016 Sensia Software LLC. All rights reserved.