com.vividsolutions.jump.workbench.datastore
Class ConnectionManager

java.lang.Object
  extended by com.vividsolutions.jump.workbench.datastore.ConnectionManager

public class ConnectionManager
extends java.lang.Object

Reuses existing connections where possible.


Nested Class Summary
static interface ConnectionManager.Listener
           
 
Method Summary
 void addListener(ConnectionManager.Listener listener)
           
 void closeConnections()
           
 void deleteConnectionDescriptor(ConnectionDescriptor connectionDescriptor)
          Removes the ConnectionDescriptor and closes its associated DataStoreConnection.
 DataStoreConnection getConnection(ConnectionDescriptor connectionDescriptor)
           
 java.util.Collection getConnectionDescriptors()
           
 DataStoreDriver getDriver(java.lang.String driverClassName)
           
 DataStoreConnection getOpenConnection(ConnectionDescriptor connectionDescriptor)
           
static ConnectionManager instance(WorkbenchContext context)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOpenConnection

public DataStoreConnection getOpenConnection(ConnectionDescriptor connectionDescriptor)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

getDriver

public DataStoreDriver getDriver(java.lang.String driverClassName)

getConnection

public DataStoreConnection getConnection(ConnectionDescriptor connectionDescriptor)
Returns:
a connection, possibly closed, never null

getConnectionDescriptors

public java.util.Collection 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()
                      throws DataStoreException
Throws:
DataStoreException