org.apache.torque.dsfactory
Class PerUserPoolDataSourceFactory
java.lang.Object
org.apache.torque.dsfactory.AbstractDataSourceFactory
org.apache.torque.dsfactory.PerUserPoolDataSourceFactory
- All Implemented Interfaces:
- DataSourceFactory
- public class PerUserPoolDataSourceFactory
- extends AbstractDataSourceFactory
- implements DataSourceFactory
A factory that looks up the DataSource using the JDBC2 pool methods.
- Version:
- $Id: PerUserPoolDataSourceFactory.java,v 1.1 2003/08/19 19:09:12 mpoeschl Exp $
- Author:
- John McNally, Henning P. Schmiedehausen
Field Summary |
private javax.sql.DataSource |
ds
The wrapped DataSource . |
private static org.apache.commons.logging.Log |
log
The log. |
Method Summary |
javax.sql.DataSource |
getDataSource()
|
void |
initialize(org.apache.commons.configuration.Configuration configuration)
Initialize the factory. |
private org.apache.commons.dbcp.datasources.PerUserPoolDataSource |
initJdbc2Pool(org.apache.commons.configuration.Configuration configuration)
Initializes the Jdbc2PoolDataSource. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.commons.logging.Log log
- The log.
ds
private javax.sql.DataSource ds
- The wrapped
DataSource
.
PerUserPoolDataSourceFactory
public PerUserPoolDataSourceFactory()
getDataSource
public javax.sql.DataSource getDataSource()
- Specified by:
getDataSource
in interface DataSourceFactory
- Returns:
- the
DataSource
configured by the factory. - See Also:
DataSourceFactory.getDataSource()
initialize
public void initialize(org.apache.commons.configuration.Configuration configuration)
throws TorqueException
- Description copied from interface:
DataSourceFactory
- Initialize the factory.
- Specified by:
initialize
in interface DataSourceFactory
- Parameters:
configuration
- where to load the factory settings from
- Throws:
TorqueException
- Any exceptions caught during processing will be
rethrown wrapped into a TorqueException.- See Also:
DataSourceFactory.initialize(org.apache.commons.configuration.Configuration)
initJdbc2Pool
private org.apache.commons.dbcp.datasources.PerUserPoolDataSource initJdbc2Pool(org.apache.commons.configuration.Configuration configuration)
throws TorqueException
- Initializes the Jdbc2PoolDataSource.
- Parameters:
configuration
- where to read the settings from
- Returns:
- a configured
Jdbc2PoolDataSource
- Throws:
TorqueException
- if a property set fails
Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.