Class SharedPoolDataSourceFactory
java.lang.Object
org.apache.commons.jcs3.auxiliary.disk.jdbc.dsfactory.SharedPoolDataSourceFactory
- All Implemented Interfaces:
DataSourceFactory
A factory that looks up the DataSource using the JDBC2 pool methods.
Borrowed and adapted from Apache DB Torque
-
Field Summary
Fields inherited from interface org.apache.commons.jcs3.auxiliary.disk.jdbc.dsfactory.DataSourceFactory
DSFACTORY_KEY, FACTORY_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the pool associated with this factory and releases it.getName()
void
initialize
(JDBCDiskCacheAttributes config) Initialize the factory.
-
Constructor Details
-
SharedPoolDataSourceFactory
public SharedPoolDataSourceFactory()
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceDataSourceFactory
- Returns:
- the name of the factory.
-
getDataSource
- Specified by:
getDataSource
in interfaceDataSourceFactory
- Returns:
- the
DataSource
configured by the factory. - See Also:
-
initialize
Description copied from interface:DataSourceFactory
Initialize the factory.- Specified by:
initialize
in interfaceDataSourceFactory
- Parameters:
config
- the factory settings- Throws:
SQLException
- Any exceptions caught during processing will be rethrown wrapped into a SQLException.- See Also:
-
close
Closes the pool associated with this factory and releases it.- Specified by:
close
in interfaceDataSourceFactory
- Throws:
SQLException
- if the pool cannot be closed properly
-