fedora.server.storage
Class ConnectionPoolManagerImpl

java.lang.Object
  extended byfedora.server.Parameterized
      extended byfedora.server.Pluggable
          extended byfedora.server.Module
              extended byfedora.server.storage.ConnectionPoolManagerImpl
All Implemented Interfaces:
ConnectionPoolManager, Logging

public class ConnectionPoolManagerImpl
extends Module
implements ConnectionPoolManager

Title: ConnectionPoolManagerImpl.java

Description: Implements ConnectionPoolManager to facilitate obtaining database connection pools. This class initializes the connection pools specified by parameters in the Fedora fedora.fcfg configuration file. The Fedora server must be instantiated in order for this class to function properly.

-----------------------------------------------------------------------------

License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.

-----------------------------------------------------------------------------

Version:
$Id: ConnectionPoolManagerImpl.java,v 1.16 2005/01/11 20:06:07 cwilper Exp $
Author:
rlw@virginia.edu

Constructor Summary
ConnectionPoolManagerImpl(java.util.Map moduleParameters, Server server, java.lang.String role)
          Constructs a new ConnectionPoolManagerImpl
 
Method Summary
 ConnectionPool getPool()
          Gets the default Connection Pool.
 ConnectionPool getPool(java.lang.String poolName)
          Gets a named connection pool.
 void initModule()
          Initializes the Module based on configuration parameters.
 
Methods inherited from class fedora.server.Module
getRole, getServer, logConfig, logFine, logFiner, logFinest, loggingConfig, loggingFine, loggingFiner, loggingFinest, loggingInfo, loggingSevere, loggingWarning, logInfo, logSevere, logWarning, postInitModule, shutdownModule
 
Methods inherited from class fedora.server.Pluggable
getHelp, getOptionalParameters, getParameterHelp, getRequiredModuleRoles, getRequiredParameters
 
Methods inherited from class fedora.server.Parameterized
getParameter, getParameters, parameterNames, setParameter, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPoolManagerImpl

public ConnectionPoolManagerImpl(java.util.Map moduleParameters,
                                 Server server,
                                 java.lang.String role)
                          throws ModuleInitializationException

Constructs a new ConnectionPoolManagerImpl

Parameters:
moduleParameters - The name/value pair map of module parameters.
server - The server instance.
role - The module role name.
Throws:
ModuleInitializationException - If initialization values are invalid or initialization fails for some other reason.
Method Detail

initModule

public void initModule()
                throws ModuleInitializationException
Initializes the Module based on configuration parameters. The implementation of this method is dependent on the schema used to define the parameter names for the role of fedora.server.storage.ConnectionPoolManager.

Overrides:
initModule in class Module
Throws:
ModuleInitializationException - If initialization values are invalid or initialization fails for some other reason.

getPool

public ConnectionPool getPool(java.lang.String poolName)
                       throws ConnectionPoolNotFoundException

Gets a named connection pool.

Specified by:
getPool in interface ConnectionPoolManager
Parameters:
poolName - The name of the connection pool.
Returns:
The named connection pool.
Throws:
ConnectionPoolNotFoundException - If the specified connection pool cannot be found.

getPool

public ConnectionPool getPool()
                       throws ConnectionPoolNotFoundException

Gets the default Connection Pool. This method overrides getPool(String poolName).

Specified by:
getPool in interface ConnectionPoolManager
Returns:
The default connection pool.
Throws:
ConnectionPoolNotFoundException - If the default connection pool cannot be found.