public class ConnectionManagerImpl extends java.lang.Object implements ConnectionManager
| Constructor and Description |
|---|
ConnectionManagerImpl(PluginManager pluginManager) |
| 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.
|
public ConnectionManagerImpl(PluginManager pluginManager)
public ConnectionObjectListener.ListenerList getConnectionListeners()
getConnectionListeners in interface ConnectionManagerpublic boolean isEnabled()
ConnectionManagerisEnabled in interface ConnectionManagerpublic void setEnabled(boolean isEnabled)
ConnectionManagersetEnabled in interface ConnectionManagerisEnabled - whether connections should be enabledpublic void clear()
clear in interface ConnectionManagerpublic <T extends Connection> T addConnection(T connection)
ConnectionManageraddConnection in interface ConnectionManagerconnection - The connection to be registeredpublic Connection getConnection(ConnectionID id) throws ConnectionCannotBeObtained
ConnectionManagergetConnection in interface ConnectionManagerid - the connection IDConnectionCannotBeObtainedpublic <T extends Connection> T getFirstConnection(java.lang.Class<T> connectionType, PluginContext context, java.lang.Object... objects) throws ConnectionCannotBeObtained
ConnectionManagergetFirstConnection in interface ConnectionManagerT - 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.public <T extends Connection> java.util.Collection<T> getConnections(java.lang.Class<T> connectionType, PluginContext context, java.lang.Object... objects) throws ConnectionCannotBeObtained
ConnectionManagergetConnections in interface ConnectionManagerT - 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.public java.util.Collection<ConnectionID> getConnectionIDs()
ConnectionManagergetConnectionIDs in interface ConnectionManager