public abstract class DataSourceRT
extends java.lang.Object
implements com.serotonin.util.ILifecycle
Modifier and Type | Field and Description |
---|---|
protected java.util.List<DataPointRT> |
addedChangedPoints
Under the expectation that most data sources will run in their own
threads, the addedPoints field is used as a cache for points that have
been added to the data source, so that at a convenient time for the data
source they can be included in the polling.
|
static java.lang.String |
ATTR_DISCONNECTED_KEY |
static java.lang.String |
ATTR_UNRELIABLE_KEY |
private java.util.List<DataSourceEventType> |
eventTypes |
protected java.lang.Boolean |
pointListChangeLock
Access to either the addedPoints or removedPoints lists should be
synchronized with this object's monitor.
|
protected java.util.List<DataPointRT> |
removedPoints
Under the expectation that most data sources will run in their own
threads, the removedPoints field is used as a cache for points that have
been removed from the data source, so that at a convenient time for the
data source they can be removed from the polling.
|
private DataSourceVO<?> |
vo |
Constructor and Description |
---|
DataSourceRT(DataSourceVO<?> vo) |
Modifier and Type | Method and Description |
---|---|
void |
addDataPoint(DataPointRT dataPoint) |
void |
beginPolling() |
void |
forcePointRead(DataPointRT dataPoint) |
private DataSourceEventType |
getEventType(int eventId) |
protected static com.serotonin.web.i18n.LocalizableMessage |
getExceptionMessage(java.lang.Exception e) |
int |
getId() |
java.lang.String |
getName() |
java.lang.Object |
getPersistentData()
This method is usable by subclasses to retrieve serializable data stored
using the setPersistentData method.
|
protected com.serotonin.web.i18n.LocalizableMessage |
getSerialExceptionMessage(java.lang.Exception e,
java.lang.String portId) |
void |
initialize() |
void |
joinTermination() |
protected void |
raiseEvent(int eventId,
long time,
boolean rtn,
com.serotonin.web.i18n.LocalizableMessage message) |
void |
relinquish(DataPointRT dataPoint) |
void |
removeDataPoint(DataPointRT dataPoint) |
protected void |
returnToNormal(int eventId,
long time) |
protected void |
setPersistentData(java.lang.Object persistentData)
This method is usable by subclasses to store any type of serializable
data.
|
abstract void |
setPointValue(DataPointRT dataPoint,
PointValueTime valueTime,
SetPointSource source) |
void |
terminate() |
public static final java.lang.String ATTR_UNRELIABLE_KEY
public static final java.lang.String ATTR_DISCONNECTED_KEY
private final DataSourceVO<?> vo
protected java.util.List<DataPointRT> addedChangedPoints
protected java.util.List<DataPointRT> removedPoints
protected java.lang.Boolean pointListChangeLock
private final java.util.List<DataSourceEventType> eventTypes
public DataSourceRT(DataSourceVO<?> vo)
public int getId()
public java.lang.String getName()
public java.lang.Object getPersistentData()
protected void setPersistentData(java.lang.Object persistentData)
public void addDataPoint(DataPointRT dataPoint)
public void removeDataPoint(DataPointRT dataPoint)
public abstract void setPointValue(DataPointRT dataPoint, PointValueTime valueTime, SetPointSource source)
public void relinquish(DataPointRT dataPoint)
public void forcePointRead(DataPointRT dataPoint)
protected void raiseEvent(int eventId, long time, boolean rtn, com.serotonin.web.i18n.LocalizableMessage message)
protected void returnToNormal(int eventId, long time)
private DataSourceEventType getEventType(int eventId)
protected com.serotonin.web.i18n.LocalizableMessage getSerialExceptionMessage(java.lang.Exception e, java.lang.String portId)
protected static com.serotonin.web.i18n.LocalizableMessage getExceptionMessage(java.lang.Exception e)
public void initialize()
initialize
in interface com.serotonin.util.ILifecycle
public void terminate()
terminate
in interface com.serotonin.util.ILifecycle
public void joinTermination()
joinTermination
in interface com.serotonin.util.ILifecycle
public void beginPolling()