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 TypeMethodDescriptionvoid
addPropertyChangeListener.void
destroy()
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.void
getMetaDataAsync.getName()
Returns remote name for this connection.getPoop()
getPoop.getStatus.getValue()
Synchronously obtains remote value and returns it.getValue.boolean
hasLastPoop.boolean
isConnected.boolean
Returnstrue
after destroy method was called.boolean
isReady()
Returns true, when this connection object is connected and has received at least one remote update.void
removePropertyChangeListener.void
setValue.setValue
(T value, ResponseListener<DummyConnector> l) setValue.void
It 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:
getName
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- remote name
-
getConnector
Returns Connector object responsible for this connection.- Specified by:
getConnector
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- a C object
-
getMetaData
getMetaData.
- Specified by:
getMetaData
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- a
MetaData
object
-
getMetaDataAsync
getMetaDataAsync.
- Specified by:
getMetaDataAsync
in interfaceConnection<DummyConnector,
T, Object> - Parameters:
l
- aPropertyChangeListener
object
-
getDataType
getDataType.
- Specified by:
getDataType
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- a
DataType
object
-
getValue
Synchronously obtains remote value and returns it. This call is blocked until value is returned.- Specified by:
getValue
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- remote value
- Throws:
RemoteException
- if retrieving value fails
-
getPoop
getPoop.
- Specified by:
getPoop
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- a
Poop
object - Throws:
RemoteException
- if any.
-
setValue
setValue.
- Specified by:
setValue
in 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:
addPropertyChangeListener
in interfaceConnection<DummyConnector,
T, Object> - Parameters:
pName
- aString
objectl
- aPropertyChangeListener
object- Throws:
RemoteException
- if any.
-
removePropertyChangeListener
removePropertyChangeListener.
- Specified by:
removePropertyChangeListener
in interfaceConnection<DummyConnector,
T, Object> - Parameters:
pName
- aString
objectl
- aPropertyChangeListener
object
-
destroy
public void destroy()destroy.
- Specified by:
destroy
in 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:
isReady
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- returns true, when connection is ready to be used
-
isDestroyed
public boolean isDestroyed()Returnstrue
after destroy method was called.- Specified by:
isDestroyed
in interfaceConnection<DummyConnector,
T, Object> - Returns:
true
after destroy method was called
-
isConnected
public boolean isConnected()isConnected.
- Specified by:
isConnected
in 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:
waitTillConnected
in interfaceConnection<DummyConnector,
T, Object>
-
hasLastPoop
public boolean hasLastPoop()hasLastPoop.
- Specified by:
hasLastPoop
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- a boolean
-
getLastValue
Returns value from last Poop converted to data type of the connection, if possible.- Specified by:
getLastValue
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- the last value from last Poop
-
getLastPoop
getLastPoop.
- Specified by:
getLastPoop
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- a
Poop
object
-
setValue
public Request<DummyConnector> setValue(T value, ResponseListener<DummyConnector> l) throws RemoteException setValue.
- Specified by:
setValue
in interfaceConnection<DummyConnector,
T, Object> - Parameters:
value
- a T objectl
- aResponseListener
object- Returns:
- a
Request
object - Throws:
RemoteException
- if any.
-
getValue
getValue.
- Specified by:
getValue
in interfaceConnection<DummyConnector,
T, Object> - Parameters:
l
- aResponseListener
object- Returns:
- a
Request
object - Throws:
RemoteException
- if any.
-
getStatus
getStatus.
- Specified by:
getStatus
in interfaceConnection<DummyConnector,
T, Object> - Returns:
- a
Status
object
-