Package net.officefloor.jdbc.pool
Class ThreadLocalJdbcConnectionPoolSource
- java.lang.Object
-
- net.officefloor.compile.spi.pool.source.impl.AbstractManagedObjectPoolSource
-
- net.officefloor.jdbc.pool.ThreadLocalJdbcConnectionPoolSource
-
- All Implemented Interfaces:
ManagedObjectPoolSource
,ManagedObjectPoolFactory
public class ThreadLocalJdbcConnectionPoolSource extends AbstractManagedObjectPoolSource implements ManagedObjectPoolFactory
Connection
ManagedObjectPoolSource
implementation that usesThreadLocal
instances to reduce contention of retrievingConnection
from singleton pool.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.compile.spi.pool.source.impl.AbstractManagedObjectPoolSource
AbstractManagedObjectPoolSource.MetaDataContext, AbstractManagedObjectPoolSource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_CONNECTION_WAIT_TIME
Property
name for the wait time (in milliseconds) for aConnection
.static java.lang.String
PROPERTY_MAXIMUM_CONNECTIONS
Property
name for the maximum number ofConnection
instances.
-
Constructor Summary
Constructors Constructor Description ThreadLocalJdbcConnectionPoolSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManagedObjectPool
createManagedObjectPool(ManagedObjectPoolContext managedObjectPoolContext)
Creates aManagedObjectPool
.protected void
loadMetaData(AbstractManagedObjectPoolSource.MetaDataContext context)
Overridden to load meta-data.protected void
loadSpecification(AbstractManagedObjectPoolSource.SpecificationContext context)
Overridden to load specification.-
Methods inherited from class net.officefloor.compile.spi.pool.source.impl.AbstractManagedObjectPoolSource
getSpecification, init
-
-
-
-
Field Detail
-
PROPERTY_MAXIMUM_CONNECTIONS
public static final java.lang.String PROPERTY_MAXIMUM_CONNECTIONS
Property
name for the maximum number ofConnection
instances.- See Also:
- Constant Field Values
-
PROPERTY_CONNECTION_WAIT_TIME
public static final java.lang.String PROPERTY_CONNECTION_WAIT_TIME
Property
name for the wait time (in milliseconds) for aConnection
.- See Also:
- Constant Field Values
-
-
Method Detail
-
loadSpecification
protected void loadSpecification(AbstractManagedObjectPoolSource.SpecificationContext context)
Description copied from class:AbstractManagedObjectPoolSource
Overridden to load specification.- Specified by:
loadSpecification
in classAbstractManagedObjectPoolSource
- Parameters:
context
- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractManagedObjectPoolSource.MetaDataContext context) throws java.lang.Exception
Description copied from class:AbstractManagedObjectPoolSource
Overridden to load meta-data.- Specified by:
loadMetaData
in classAbstractManagedObjectPoolSource
- Parameters:
context
- Meta-data.- Throws:
java.lang.Exception
- If fails to load the meta-data.
-
createManagedObjectPool
public ManagedObjectPool createManagedObjectPool(ManagedObjectPoolContext managedObjectPoolContext) throws java.lang.Exception
Description copied from interface:ManagedObjectPoolFactory
Creates aManagedObjectPool
.- Specified by:
createManagedObjectPool
in interfaceManagedObjectPoolFactory
- Parameters:
managedObjectPoolContext
-ManagedObjectPoolContext
.- Returns:
ManagedObjectPool
.- Throws:
java.lang.Exception
-
-