public static interface DOF.Runtime.ConnectionStateListener
Modifier and Type | Method and Description |
---|---|
void |
removed(DOF.Runtime runtime,
DOFException exception)
Called when this listener is removed from the DOF.Runtime, either through use of
DOF.Runtime.removeConnectionListener(org.opendof.core.oal.DOF.Runtime.ConnectionStateListener)
or because an exception caused the listener to be removed. |
void |
stateChanged(DOF.Runtime runtime,
DOFConnection connection,
DOFConnection.State state)
Called whenever the
DOFConnection.State.isConnected() value changes for any of the DOF's connections. |
void stateChanged(DOF.Runtime runtime, DOFConnection connection, DOFConnection.State state)
DOFConnection.State.isConnected()
value changes for any of the DOF's connections.
This method is called immediately for all connections when the listener is added, and then will be called whenever a connection's
connected state changes. For each connection, the library guarantees that calls to this method will occur in the same order
as the associated state change, so that, for example, if a connection rapidly connects and then disconnects, you won't mistakenly
receive the disconnect notification before the connect notification.runtime
- The runtime instance associated with this listener. This will never be null.connection
- The DOFConnection
that changed state. This will never be null.state
- The updated state of the connection. This will never be null.void removed(DOF.Runtime runtime, DOFException exception)
DOF.Runtime.removeConnectionListener(org.opendof.core.oal.DOF.Runtime.ConnectionStateListener)
or because an exception caused the listener to be removed. Use this method to free any resources
allocated in association with this listener. After this method is called, the listener will no longer be called.
You may leave this method empty to ignore notification of removal.runtime
- The runtime instance associated with this listener. This will never be null.exception
- The exception that caused this listener to be removed. This will be null if the listener was removed normally.