Class ConnectionManager
java.lang.Object
com.vividsolutions.jump.workbench.datastore.ConnectionManager
Reuses existing connections where possible.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ConnectionManager.Listener listener) voidcloseConnection(SpatialDSLayer layer2remove) used bySpatialDSLayer.dispose()close the connection utilized by the layer given if no other layer is currently needing itvoidcloseConnection(ConnectionDescriptor cd2remove) try to close the connection for the given connection descriptorvoidrun by Exit handler, close allvoidclose all connections currently not used by any layer in any open taskvoiddeleteConnectionDescriptor(ConnectionDescriptor connectionDescriptor) Removes the ConnectionDescriptor and closes its associated DataStoreConnection.getConnection(ConnectionDescriptor connectionDescriptor) getOpenConnection(ConnectionDescriptor connectionDescriptor) static ConnectionManagerinstance(WorkbenchContext context)
-
Method Details
-
getOpenConnection
public DataStoreConnection getOpenConnection(ConnectionDescriptor connectionDescriptor) throws Exception - Throws:
Exception
-
getDriver
-
getConnection
- Returns:
- a connection, possibly closed, never null
-
getConnectionDescriptors
-
deleteConnectionDescriptor
public void deleteConnectionDescriptor(ConnectionDescriptor connectionDescriptor) throws DataStoreException Removes the ConnectionDescriptor and closes its associated DataStoreConnection.- Throws:
DataStoreException
-
instance
-
addListener
-
closeConnections
public void closeConnections()run by Exit handler, close all- Throws:
DataStoreException- if a DataStoreException occurs during connections closing
-
closeConnectionsUnused
public void closeConnectionsUnused()close all connections currently not used by any layer in any open task -
closeConnection
used bySpatialDSLayer.dispose()close the connection utilized by the layer given if no other layer is currently needing it -
closeConnection
try to close the connection for the given connection descriptor
-