Class ConnectionManager
- java.lang.Object
-
- com.vividsolutions.jump.workbench.datastore.ConnectionManager
-
public class ConnectionManager extends Object
Reuses existing connections where possible.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ConnectionManager.Listener
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(ConnectionManager.Listener listener)
void
closeConnection(SpatialDSLayer layer2remove)
used bySpatialDSLayer.dispose()
close the connection utilized by the layer given if no other layer is currently needing itvoid
closeConnection(ConnectionDescriptor cd2remove)
try to close the connection for the given connection descriptorvoid
closeConnections()
run by Exit handler, close allvoid
closeConnectionsUnused()
close all connections currently not used by any layer in any open taskvoid
deleteConnectionDescriptor(ConnectionDescriptor connectionDescriptor)
Removes the ConnectionDescriptor and closes its associated DataStoreConnection.DataStoreConnection
getConnection(ConnectionDescriptor connectionDescriptor)
Collection<ConnectionDescriptor>
getConnectionDescriptors()
DataStoreDriver
getDriver(String driverClassName)
DataStoreConnection
getOpenConnection(ConnectionDescriptor connectionDescriptor)
static ConnectionManager
instance(WorkbenchContext context)
-
-
-
Method Detail
-
getOpenConnection
public DataStoreConnection getOpenConnection(ConnectionDescriptor connectionDescriptor) throws Exception
- Throws:
Exception
-
getDriver
public DataStoreDriver getDriver(String driverClassName)
-
getConnection
public DataStoreConnection getConnection(ConnectionDescriptor connectionDescriptor)
- Returns:
- a connection, possibly closed, never null
-
getConnectionDescriptors
public Collection<ConnectionDescriptor> getConnectionDescriptors()
-
deleteConnectionDescriptor
public void deleteConnectionDescriptor(ConnectionDescriptor connectionDescriptor) throws DataStoreException
Removes the ConnectionDescriptor and closes its associated DataStoreConnection.- Throws:
DataStoreException
-
instance
public static ConnectionManager instance(WorkbenchContext context)
-
addListener
public void addListener(ConnectionManager.Listener listener)
-
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
public void closeConnection(SpatialDSLayer layer2remove)
used bySpatialDSLayer.dispose()
close the connection utilized by the layer given if no other layer is currently needing it
-
closeConnection
public void closeConnection(ConnectionDescriptor cd2remove)
try to close the connection for the given connection descriptor
-
-