Package org.apache.torque.dsfactory
Class PerUserPool2DataSourceFactory
java.lang.Object
org.apache.torque.dsfactory.AbstractDataSourceFactory
org.apache.torque.dsfactory.PerUserPool2DataSourceFactory
- All Implemented Interfaces:
DataSourceFactory
A factory that looks up the DataSource using the DBCP2 pool methods.
- Version:
- $Id: PerUserPoolDataSourceFactory.java 1485956 2013-05-24 07:55:47Z tfischer $
- Author:
- Thomas Vandahl
-
Field Summary
Fields inherited from class org.apache.torque.dsfactory.AbstractDataSourceFactory
CONNECTION_KEY, DEFAULT_CONNECTION_KEY, DEFAULT_POOL_KEY, DEFAULTS_KEY, POOL_KEY, USE_DURATION_TEXT_FORMATFields inherited from interface org.apache.torque.dsfactory.DataSourceFactory
DSFACTORY_KEY, FACTORY_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the pool associated with this factory and releases it.voidinitialize(org.apache.commons.configuration2.Configuration configuration) Initialize the factory.Methods inherited from class org.apache.torque.dsfactory.AbstractDataSourceFactory
applyAndRemoveGlobal, applyConfiguration, initCPDS, initJdbc2Pool, setProperty
-
Constructor Details
-
PerUserPool2DataSourceFactory
public PerUserPool2DataSourceFactory()
-
-
Method Details
-
getDataSource
- Specified by:
getDataSourcein interfaceDataSourceFactory- Specified by:
getDataSourcein classAbstractDataSourceFactory- Returns:
- the
DataSourceconfigured by the factory. - See Also:
-
initialize
public void initialize(org.apache.commons.configuration2.Configuration configuration) throws TorqueException Description copied from class:AbstractDataSourceFactoryInitialize the factory.- Specified by:
initializein interfaceDataSourceFactory- Specified by:
initializein classAbstractDataSourceFactory- 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:
-
close
Closes the pool associated with this factory and releases it.- Throws:
TorqueException- if the pool cannot be closed properly
-