com.metamatrix.soap.service
Class PoolingConnectionSource
java.lang.Object
com.metamatrix.soap.service.PoolingConnectionSource
- All Implemented Interfaces:
- ConnectionSource
public class PoolingConnectionSource
- extends java.lang.Object
- implements ConnectionSource
This implmentation of ConnectionSource uses a HashMap to cache instances of Connection Pools with their connection properties
as the key.
Method Summary |
java.sql.Connection |
getConnection(java.util.Properties connectionProperties)
|
static PoolingConnectionSource |
getInstance()
|
protected boolean |
hasPool(java.util.Properties connectionProperties)
This method can be used to check to see if this Connection Source has a poool with
the passed in properties |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PoolingConnectionSource
public PoolingConnectionSource()
- Constructor that instantiates a BasicConnectionPoolFactory for pool creation duties.
PoolingConnectionSource
public PoolingConnectionSource(ConnectionPoolFactory poolFactory)
- Constructor that allows the user to pass in their own implementation of ConnectionPoolFactory.
- Parameters:
poolFactory
- the connection pool factory that will be used to create connection pools.
getInstance
public static PoolingConnectionSource getInstance()
getConnection
public java.sql.Connection getConnection(java.util.Properties connectionProperties)
throws java.sql.SQLException
- Specified by:
getConnection
in interface ConnectionSource
- Throws:
java.sql.SQLException
- Since:
- 4.3
- See Also:
ConnectionSource.getConnection(java.util.Properties)
hasPool
protected boolean hasPool(java.util.Properties connectionProperties)
- This method can be used to check to see if this Connection Source has a poool with
the passed in properties
- Parameters:
connectionProperties
- The properties to check to see if there is a matching pool for in
this connection source.
- Returns:
- true if a pool is found with the matching passed in properties.
Copyright © 2009. All Rights Reserved.