public class ItemManagerImpl extends Object implements ConnectionStateListener, ItemManager
Modifier and Type | Field and Description |
---|---|
protected Connection |
connection |
Constructor and Description |
---|
ItemManagerImpl(Connection connection)
Create a new item manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addItemUpdateListener(String itemName,
ItemUpdateListener listener) |
protected void |
disconnectAllItems() |
Connection |
getConnection()
Get the current assigned connection
|
Executor |
getExecutor() |
void |
removeItemUpdateListener(String itemName,
ItemUpdateListener listener) |
protected void |
resyncAllItems()
Synchronized all items that are currently known
|
void |
stateChange(Connection connection,
ConnectionState state,
Throwable error)
Notify a state change
|
protected Connection connection
public ItemManagerImpl(Connection connection)
Only one item manager should be created per connection since the item
manager acquires the listeners for data items using
Connection.setItemUpdateListener(String, ItemUpdateListener)
which directs all further updates to this item manager an disconnects all
other item managers. So item managers should be shared.
connection
- the new connection to use for this item managerpublic Executor getExecutor()
public Connection getConnection()
null
if none is assigned.public void addItemUpdateListener(String itemName, ItemUpdateListener listener)
addItemUpdateListener
in interface ItemManager
public void removeItemUpdateListener(String itemName, ItemUpdateListener listener)
removeItemUpdateListener
in interface ItemManager
protected void resyncAllItems()
protected void disconnectAllItems()
public void stateChange(Connection connection, ConnectionState state, Throwable error)
ConnectionStateListener
stateChange
in interface ConnectionStateListener
connection
- the connection that changedstate
- the new state of the connectionerror
- some error information that lead to the new state (can be null
if it was not an error)Copyright © 2016 Eclipse NeoSCADA Project. All rights reserved.