public abstract static class DatabaseFactory.ConnectionCreator
extends java.lang.Object
| Constructor and Description |
|---|
ConnectionCreator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cacheDatabase(java.lang.String connName,
Database db) |
protected abstract java.sql.Connection |
createConnectionImpl(java.lang.String connName)
Creates a Connection from a registered connection store if a connection
of given name exists.
|
Database |
findDatabase(java.lang.String connName) |
protected java.lang.String |
getDisplayableStoreName() |
protected abstract java.lang.String |
getStoreName() |
protected boolean |
isActive() |
java.util.Collection<java.lang.String> |
listDatabases()
Lists the databases that exist in the cache, not the connections
available in the underlying connection store.
|
boolean |
renameDatabase(java.lang.String oldName,
java.lang.String newName) |
boolean |
shouldClearCaches(java.sql.Connection oldConn,
java.sql.Connection newConn,
Database db)
Called on reconnect to test whether a Database should clear its
caches of objects and privileges before using the new conenction.
|
Database |
uncacheDatabase(java.lang.String connName) |
protected abstract java.sql.Connection createConnectionImpl(java.lang.String connName)
throws DBException
DBExceptionprotected boolean isActive()
protected abstract java.lang.String getStoreName()
protected java.lang.String getDisplayableStoreName()
public boolean shouldClearCaches(java.sql.Connection oldConn,
java.sql.Connection newConn,
Database db)
oldConn - the old connection to compare - this should already be
closed.newConn - the new connection to compare - this should have been
created by createConnectionImpl(String) to replace the
closed oldConn.db - the Database that will have its caches cleared.public java.util.Collection<java.lang.String> listDatabases()
public Database findDatabase(java.lang.String connName)
public Database uncacheDatabase(java.lang.String connName)
protected void cacheDatabase(java.lang.String connName,
Database db)
public boolean renameDatabase(java.lang.String oldName,
java.lang.String newName)