private static class ConnectionManager.ConnectionDispatcher
extends java.lang.Object
ConnectionManager
instance.Modifier and Type | Field and Description |
---|---|
private java.util.Set<ConnectionManager.ConnectInfo> |
connections
Set of connection info, maintained for context cleanup purposes
|
private java.util.Map<Database,ConnectionListener> |
listeners
Map of primary database to
ConnectionListener objects |
Modifier | Constructor and Description |
---|---|
private |
ConnectionDispatcher() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
cleanup()
This method is called during context cleanup to ensure that any connection listeners which might
still be active at this time are notified about the disconnection event.
|
(package private) void |
connected(ConnectionManager.ConnectInfo info)
Manage a connection event by dispatching it to the appropriate listener.
|
(package private) void |
disconnected(ConnectionManager.ConnectInfo info)
Manage a disconnection event by dispatching it to the appropriate listener.
|
private void |
fireDisconnected(ConnectionManager.ConnectInfo info)
Fire a disconnection event to the appropriate listener.
|
private ConnectionListener |
getListener(Database database)
Get the connection listener for the given, primary database.
|
private final java.util.Map<Database,ConnectionListener> listeners
ConnectionListener
objectsprivate final java.util.Set<ConnectionManager.ConnectInfo> connections
void connected(ConnectionManager.ConnectInfo info)
info
- Information about the connection to the associated, primary database.void disconnected(ConnectionManager.ConnectInfo info)
info
- Information about the disconnection from the associated, primary database.void cleanup()
private void fireDisconnected(ConnectionManager.ConnectInfo info)
info
- Information about the disconnection from the associated, primary database.private ConnectionListener getListener(Database database)
database
- Primary database.