Package org.scictrl.csshell.dummy
Class DummyConnection<T>
java.lang.Object
org.scictrl.csshell.dummy.DummyConnection<T>
- Type Parameters:
T- data type
- All Implemented Interfaces:
Connection<DummyConnector,T, Object>
DummyConnection class.
- Author:
- igor@scictrl.com
-
Field Summary
Fields inherited from interface org.scictrl.csshell.Connection
PROPERTY_ALARM, PROPERTY_META_DATA, PROPERTY_POOP, PROPERTY_STATUS, PROPERTY_VALUE -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener.voiddestroy()destroy.Returns Connector object responsible for this connection.getDataType.getLastPoop.Returns value from last Poop converted to data type of the connection, if possible.getMetaData.voidgetMetaDataAsync.getName()Returns remote name for this connection.getPoop()getPoop.getStatus.getValue()Synchronously obtains remote value and returns it.getValue.booleanhasLastPoop.booleanisConnected.booleanReturnstrueafter destroy method was called.booleanisReady()Returns true, when this connection object is connected and has received at least one remote update.voidremovePropertyChangeListener.voidsetValue.setValue(T value, ResponseListener<DummyConnector> l) setValue.voidIt will block this call until this connection is connected or timeout occurs and connection fails.
-
Method Details
-
getName
Returns remote name for this connection.- Specified by:
getNamein interfaceConnection<DummyConnector,T, Object> - Returns:
- remote name
-
getConnector
Returns Connector object responsible for this connection.- Specified by:
getConnectorin interfaceConnection<DummyConnector,T, Object> - Returns:
- a C object
-
getMetaData
getMetaData.
- Specified by:
getMetaDatain interfaceConnection<DummyConnector,T, Object> - Returns:
- a
MetaDataobject
-
getMetaDataAsync
getMetaDataAsync.
- Specified by:
getMetaDataAsyncin interfaceConnection<DummyConnector,T, Object> - Parameters:
l- aPropertyChangeListenerobject
-
getDataType
getDataType.
- Specified by:
getDataTypein interfaceConnection<DummyConnector,T, Object> - Returns:
- a
DataTypeobject
-
getValue
Synchronously obtains remote value and returns it. This call is blocked until value is returned.- Specified by:
getValuein interfaceConnection<DummyConnector,T, Object> - Returns:
- remote value
- Throws:
RemoteException- if retrieving value fails
-
getPoop
getPoop.
- Specified by:
getPoopin interfaceConnection<DummyConnector,T, Object> - Returns:
- a
Poopobject - Throws:
RemoteException- if any.
-
setValue
setValue.
- Specified by:
setValuein interfaceConnection<DummyConnector,T, Object> - Parameters:
value- a T object- Throws:
RemoteException- if any.
-
addPropertyChangeListener
public void addPropertyChangeListener(String pName, PropertyChangeListener l) throws RemoteException addPropertyChangeListener.
- Specified by:
addPropertyChangeListenerin interfaceConnection<DummyConnector,T, Object> - Parameters:
pName- aStringobjectl- aPropertyChangeListenerobject- Throws:
RemoteException- if any.
-
removePropertyChangeListener
removePropertyChangeListener.
- Specified by:
removePropertyChangeListenerin interfaceConnection<DummyConnector,T, Object> - Parameters:
pName- aStringobjectl- aPropertyChangeListenerobject
-
destroy
public void destroy()destroy.
- Specified by:
destroyin interfaceConnection<DummyConnector,T, Object>
-
isReady
public boolean isReady()Returns true, when this connection object is connected and has received at least one remote update. This means that remote connection is successfully established (CONNECTED status state) and alive (no warnings, alarms or errors states in status). As remote update counts that hasLastPoop() returns true, which is consequence of least one successful get call was made or there is property listener registered on this object and remote monitor has already returned at least one monitor update.- Specified by:
isReadyin interfaceConnection<DummyConnector,T, Object> - Returns:
- returns true, when connection is ready to be used
-
isDestroyed
public boolean isDestroyed()Returnstrueafter destroy method was called.- Specified by:
isDestroyedin interfaceConnection<DummyConnector,T, Object> - Returns:
trueafter destroy method was called
-
isConnected
public boolean isConnected()isConnected.
- Specified by:
isConnectedin interfaceConnection<DummyConnector,T, Object> - Returns:
- a boolean
-
waitTillConnected
public void waitTillConnected()It will block this call until this connection is connected or timeout occurs and connection fails.- Specified by:
waitTillConnectedin interfaceConnection<DummyConnector,T, Object>
-
hasLastPoop
public boolean hasLastPoop()hasLastPoop.
- Specified by:
hasLastPoopin interfaceConnection<DummyConnector,T, Object> - Returns:
- a boolean
-
getLastValue
Returns value from last Poop converted to data type of the connection, if possible.- Specified by:
getLastValuein interfaceConnection<DummyConnector,T, Object> - Returns:
- the last value from last Poop
-
getLastPoop
getLastPoop.
- Specified by:
getLastPoopin interfaceConnection<DummyConnector,T, Object> - Returns:
- a
Poopobject
-
setValue
public Request<DummyConnector> setValue(T value, ResponseListener<DummyConnector> l) throws RemoteException setValue.
- Specified by:
setValuein interfaceConnection<DummyConnector,T, Object> - Parameters:
value- a T objectl- aResponseListenerobject- Returns:
- a
Requestobject - Throws:
RemoteException- if any.
-
getValue
getValue.
- Specified by:
getValuein interfaceConnection<DummyConnector,T, Object> - Parameters:
l- aResponseListenerobject- Returns:
- a
Requestobject - Throws:
RemoteException- if any.
-
getStatus
getStatus.
- Specified by:
getStatusin interfaceConnection<DummyConnector,T, Object> - Returns:
- a
Statusobject
-