public interface ConnectionManager
Modifier and Type | Method and Description |
---|---|
<T extends Connection> |
addConnection(T connection)
Adds the given connection to the framework.
|
void |
clear() |
Connection |
getConnection(ConnectionID id)
Returns the connection with the given ID.
|
java.util.Collection<ConnectionID> |
getConnectionIDs()
Returns a collection of connection IDs registered to this global context.
|
ConnectionObjectListener.ListenerList |
getConnectionListeners()
Returns the list of registered connectionObject listeners
|
<T extends Connection> |
getConnections(java.lang.Class<T> connectionType,
PluginContext context,
java.lang.Object... objects)
Returns a collection of connections between the objects specified, such
that the type of the connection is assignable from the given
connectionType (unless the parameter equals null).
|
<T extends Connection> |
getFirstConnection(java.lang.Class<T> connectionType,
PluginContext context,
java.lang.Object... objects)
Returns a connection between the objects specified, such that the type of
the connection is assignable from the given connectionType (unless the
parameter equals null).
|
boolean |
isEnabled()
Returns whether connections are enabled.
|
void |
setEnabled(boolean isEnabled)
Sets whether connections are enabled.
|
<T extends Connection> java.util.Collection<T> getConnections(java.lang.Class<T> connectionType, PluginContext context, java.lang.Object... objects) throws ConnectionCannotBeObtained
T
- the type of the requested connection.connectionType
- The type of the object requested. This type can be null, in
which case all types are considered.context
- The context which requests the connection. If a plugin is
invoked to create a connection, a child context of this
context is instantiatedobjects
- the objects which should be connected by the requested
connection. There might be more objects involved in the
connectionConnectionCannotBeObtained
- if the requested connection does not exist and cannot be
produced in the given context.<T extends Connection> T getFirstConnection(java.lang.Class<T> connectionType, PluginContext context, java.lang.Object... objects) throws ConnectionCannotBeObtained
T
- the type of the requested connection.connectionType
- The type of the object requested. This type can be null, in
which case all types are considered.context
- The context which requests the connection. If a plugin is
invoked to create a connection, a child context of this
context is instantiatedobjects
- the objects which should be connected by the requested
connection. There might be more objects involved in the
connectionConnectionCannotBeObtained
- if the requested connection does not exist and cannot be
produced in the given context.Connection getConnection(ConnectionID id) throws ConnectionCannotBeObtained
id
- the connection IDConnectionCannotBeObtained
ConnectionObjectListener.ListenerList getConnectionListeners()
java.util.Collection<ConnectionID> getConnectionIDs()
<T extends Connection> T addConnection(T connection)
connection
- The connection to be registeredboolean isEnabled()
void setEnabled(boolean isEnabled)
isEnabled
- whether connections should be enabledvoid clear()