org.dbmaintain.database.impl
Class DefaultDatabaseConnectionManager

java.lang.Object
  extended by org.dbmaintain.database.impl.DefaultDatabaseConnectionManager
All Implemented Interfaces:
DatabaseConnectionManager

public class DefaultDatabaseConnectionManager
extends Object
implements DatabaseConnectionManager

Author:
Tim Ducheyne, Filip Neven

Field Summary
protected  Map<String,DatabaseConnection> databaseConnectionsPerDatabaseName
           
protected  DatabaseInfoFactory databaseInfoFactory
           
protected  List<DatabaseInfo> databaseInfos
           
protected  DataSourceFactory dataSourceFactory
           
protected  Map<String,DataSource> dataSourcesPerDatabaseName
           
protected  SQLHandler sqlHandler
           
 
Constructor Summary
DefaultDatabaseConnectionManager(Properties configuration, SQLHandler sqlHandler, DataSourceFactory dataSourceFactory)
           
DefaultDatabaseConnectionManager(Properties configuration, SQLHandler sqlHandler, DataSourceFactory dataSourceFactory, Map<String,DataSource> dataSourcesPerDatabaseName)
           
 
Method Summary
protected  DatabaseConnection createDatabaseConnection(String databaseName)
           
protected  DatabaseInfoFactory createDatabaseInfoFactory(Properties configuration)
           
 DatabaseConnection getDatabaseConnection(String databaseName)
          Gets the connection for the database with the given name.
 List<DatabaseConnection> getDatabaseConnections()
           
protected  DatabaseInfo getDatabaseInfo(String databaseName)
           
protected  List<DatabaseInfo> getDatabaseInfos()
           
 SQLHandler getSqlHandler()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

databaseInfos

protected List<DatabaseInfo> databaseInfos

sqlHandler

protected SQLHandler sqlHandler

databaseInfoFactory

protected DatabaseInfoFactory databaseInfoFactory

dataSourceFactory

protected DataSourceFactory dataSourceFactory

dataSourcesPerDatabaseName

protected Map<String,DataSource> dataSourcesPerDatabaseName

databaseConnectionsPerDatabaseName

protected Map<String,DatabaseConnection> databaseConnectionsPerDatabaseName
Constructor Detail

DefaultDatabaseConnectionManager

public DefaultDatabaseConnectionManager(Properties configuration,
                                        SQLHandler sqlHandler,
                                        DataSourceFactory dataSourceFactory)

DefaultDatabaseConnectionManager

public DefaultDatabaseConnectionManager(Properties configuration,
                                        SQLHandler sqlHandler,
                                        DataSourceFactory dataSourceFactory,
                                        Map<String,DataSource> dataSourcesPerDatabaseName)
Method Detail

getSqlHandler

public SQLHandler getSqlHandler()
Specified by:
getSqlHandler in interface DatabaseConnectionManager

getDatabaseConnection

public DatabaseConnection getDatabaseConnection(String databaseName)
Gets the connection for the database with the given name. The data source will be null if the database is disabled The default database always has a data source even if disabled

Specified by:
getDatabaseConnection in interface DatabaseConnectionManager
Parameters:
databaseName - The name
Returns:
The connection, not null

getDatabaseConnections

public List<DatabaseConnection> getDatabaseConnections()
Specified by:
getDatabaseConnections in interface DatabaseConnectionManager

createDatabaseConnection

protected DatabaseConnection createDatabaseConnection(String databaseName)

getDatabaseInfo

protected DatabaseInfo getDatabaseInfo(String databaseName)

getDatabaseInfos

protected List<DatabaseInfo> getDatabaseInfos()

createDatabaseInfoFactory

protected DatabaseInfoFactory createDatabaseInfoFactory(Properties configuration)


Copyright © 2011. All Rights Reserved.