T
- The type of the connection object.public abstract class ConnectionManager<T>
extends java.lang.Object
ConnectionManager
maps IConnectionAdapter
s to
IConnectionClient
s. This class manages the following aspects of the
connection-client lifecycle:
Modifier and Type | Method and Description |
---|---|
boolean |
addClient(IConnectionClient<T> client)
Adds a new connection client to the default
adapter . |
boolean |
connect()
Connects to the default
adapter . |
boolean |
disconnect()
Disconnects from the default
adapter . |
void |
preferencesChanged(java.util.Map<java.lang.String,java.lang.String> changedKeys,
java.util.Set<java.lang.String> addedKeys,
java.util.Set<java.lang.String> removedKeys)
This method notifies the manager that the preferences have changed.
|
boolean |
removeClient(IConnectionClient<T> client)
Removes a connection client from the default
adapter . |
public void preferencesChanged(java.util.Map<java.lang.String,java.lang.String> changedKeys, java.util.Set<java.lang.String> addedKeys, java.util.Set<java.lang.String> removedKeys)
public boolean connect()
adapter
. This operation does not block
the caller if the connection needs to be established.public boolean disconnect()
adapter
. This operation does not
block the caller if the connection needs to be closed.public boolean addClient(IConnectionClient<T> client)
adapter
. This method
automatically sets the client's connection adapter.client
- The client to add.public boolean removeClient(IConnectionClient<T> client)
adapter
. This
method automatically unsets the client's connection adapter.client
- The client to remove.