public class ScriptDataSource extends AbstractMultiSourceDataSource
DATA_SOURCE_ID
Constructor and Description |
---|
ScriptDataSource(org.osgi.framework.BundleContext context,
ObjectPoolTracker<DataSource> poolTracker,
ScheduledExecutorService executor,
EventProcessor eventProcessor) |
Modifier and Type | Method and Description |
---|---|
protected WriteAttributeResults |
convertAttributeResult(Map<String,Variant> attributes,
Object result) |
protected WriteResult |
convertValueResult(Object result) |
void |
dispose() |
protected void |
executeScript(ScriptExecutor command) |
protected Executor |
getExecutor()
Return the executor to use for sending out events
|
protected void |
handleChange(Map<String,DataSourceHandler> sources)
Handle data change
|
protected void |
handleTimer() |
protected Object |
performScript(ScriptExecutor command,
ScriptContext scriptContext) |
protected Object |
performWrite(ScriptExecutor command,
Variant value,
Map<String,Variant> attributes,
OperationParameters operationParameters) |
NotifyFuture<WriteAttributeResults> |
startWriteAttributes(Map<String,Variant> attributes,
OperationParameters operationParameters) |
NotifyFuture<WriteResult> |
startWriteValue(Variant value,
OperationParameters operationParameters) |
void |
update(Map<String,String> parameters) |
addDataSource, clearSources, getSourcesCopy, getType, setDataSources
addListener, removeListener, updateData
public ScriptDataSource(org.osgi.framework.BundleContext context, ObjectPoolTracker<DataSource> poolTracker, ScheduledExecutorService executor, EventProcessor eventProcessor)
protected Executor getExecutor()
AbstractDataSource
getExecutor
in class AbstractDataSource
null
protected Object performWrite(ScriptExecutor command, Variant value, Map<String,Variant> attributes, OperationParameters operationParameters) throws Exception
Exception
public NotifyFuture<WriteAttributeResults> startWriteAttributes(Map<String,Variant> attributes, OperationParameters operationParameters)
protected WriteAttributeResults convertAttributeResult(Map<String,Variant> attributes, Object result)
protected WriteResult convertValueResult(Object result)
public NotifyFuture<WriteResult> startWriteValue(Variant value, OperationParameters operationParameters)
public void dispose()
dispose
in class AbstractMultiSourceDataSource
protected void handleTimer()
protected void handleChange(Map<String,DataSourceHandler> sources)
handleChange
in class AbstractMultiSourceDataSource
protected Object performScript(ScriptExecutor command, ScriptContext scriptContext) throws Exception
Exception
protected void executeScript(ScriptExecutor command)
Copyright © 2016 Eclipse SCADA Project. All rights reserved.