public class ConnectionPool extends java.lang.Object implements ConnectionPoolMBean
ConnectionFactory| Constructor and Description |
|---|
ConnectionPool(ConnectionFactory cf)
Default connection pool constructor.
|
ConnectionPool(ConnectionFactory cf,
FList connFL)
Constructor that takes an FList containing login params.
|
ConnectionPool(ConnectionFactory cf,
java.util.Properties p)
Constructor that reads in Connectionpool-specific properties info from a
properties object
|
ConnectionPool(ConnectionFactory cf,
java.util.Properties p,
int timeOut)
Constructor that reads in Connectionpool-specific properties info from a
properties object.
|
ConnectionPool(java.lang.String host,
java.lang.String port,
java.lang.String user,
java.lang.String password,
java.lang.String service)
Constructor that takes a set of connection related properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToFreeConnection(PortalContext connection,
long lastUsedTime,
java.lang.String descr) |
void |
closeConnection(PortalContext connection,
boolean bDecCntFlag) |
protected void |
closeIdleConnections()
Closes any idle connections in the free-connection list.
|
protected java.lang.Object[] |
createConnections(int size)
Creates size number of connections and returns
|
static void |
createInstance(ConnectionFactory cf)
A helper singleton that wraps the single-argument constructor
|
static void |
createInstance(ConnectionFactory cf,
FList fl)
A helper singleton that wraps the 2-argument constructor
|
static void |
createInstance(ConnectionFactory cf,
java.util.Properties p)
A helper singleton that wraps the (connection factory, properties)
constructor
|
PortalContext |
getConnection()
Returns an instance of connection.
|
ConnectionFactory |
getConnectionFactory()
returns the current connection factory.
|
long |
getConnectionIdleTime() |
long |
getConnectionTimeOut() |
long |
getConnPoolTimeout() |
int |
getCurrentConnectionCount() |
int |
getCurrentUsedConnections() |
long |
getFailedConnRequest() |
int |
getFreeConnections() |
int |
getHighestCurConnCount() |
int |
getHighestFree() |
int |
getHighestRequestListSize() |
long |
getHighFailedConnRequest() |
int |
getHighFreeCons() |
int |
getHighPendingRequests() |
int |
getHighTotalCons() |
int |
getHighUsedConnections() |
long |
getIdleTime() |
static ConnectionPool |
getInstance()
A helper -static call to create an instance of the pool a la singleton
This creates a static instance of Connection Pool and returns it to the
calling application.
|
int |
getLowestHeadroom()
How close to queueing did we get? High headroom means that load not high
enough to warrant qeueing Zero Headroom means that queuing started
|
int |
getMaxConnections() |
int |
getMaxPoolSize() |
int |
getMaxRequestListSize() |
int |
getMinConnections() |
int |
getMinPoolSize() |
int |
getNumberOfFreeConnections() |
int |
getNumberOfPendingRequests() |
long |
getNumFailedRequest() |
long |
getNumHighFailedRequest() |
int |
getNumHighUsedConnections() |
int |
getPendingRequests() |
long |
getReconnectFrequency() |
long |
getReConnFrequency() |
int |
getRequestQSize() |
long |
getTestConnectionFrequency() |
long |
getTestFrequency() |
int |
getTotalConnections() |
int |
getUsedConnections() |
protected void |
init(java.lang.String connectionURL)
Reads in all the property settings in the property file.
|
protected boolean |
isIdleConnection(com.portal.pfc.infranet.connpool.ConnectionPool.TimedConnection tc) |
void |
ReConnectAll() |
protected void |
reEstablishAllConnections() |
void |
releaseBadConnection(PortalContext pc)
Close the bad connections TCP/IP socket, and decreasing the connection
pool size.
|
void |
releaseConnection(PortalContext connection)
This method does the following: - Checks to see if there are any threads
waiting, if not the connection is returned to the free pool and
closeIdleConnections is called.
|
void |
resetFailCount() |
void |
resetHighestStats()
Reset pool health highest stats.
|
void |
setConnectionIdleTime(long newIdleTime) |
void |
setConnectionTimeOut(long poolTimeout) |
void |
setConnPoolTimeout(long poolTimeout) |
void |
setIdleTime(long newIdleTime) |
void |
setMaxConnections(int maxConns) |
void |
setMaxPoolSize(int maxPoolSize) |
void |
setMaxRequestListSize(int reqQSize) |
void |
setMinConnections(int minConns) |
void |
setMinPoolSize(int minPoolSize) |
void |
setReconnectFrequency(long reconnFreq) |
void |
setReConnFrequency(long reconFreq) |
void |
setRequestQSize(int reqSize) |
void |
setTestConnectionFrequency(long testFreq) |
void |
setTestFrequency(long testFreq) |
void |
testFreeConnections() |
public ConnectionPool(ConnectionFactory cf) throws EBufException
cf - ConnectionFactory type to be setEBufExceptionpublic ConnectionPool(ConnectionFactory cf, java.util.Properties p) throws EBufException
cf - ConnectionFactory type to be usedp - Properties objectEBufExceptionpublic ConnectionPool(ConnectionFactory cf, FList connFL) throws EBufException
cf - ConnectionFactory type to be usedconnFL - connection FListEBufExceptionpublic ConnectionPool(java.lang.String host,
java.lang.String port,
java.lang.String user,
java.lang.String password,
java.lang.String service)
throws EBufException
host - port - user - password - service - EBufExceptionpublic ConnectionPool(ConnectionFactory cf, java.util.Properties p, int timeOut) throws EBufException
cf - p - timeOut - value in millisecondsEBufExceptionpublic void setMaxPoolSize(int maxPoolSize)
setMaxPoolSize in interface ConnectionPoolMBeanpublic int getMaxPoolSize()
getMaxPoolSize in interface ConnectionPoolMBeanpublic void setMinPoolSize(int minPoolSize)
setMinPoolSize in interface ConnectionPoolMBeanpublic int getMinPoolSize()
getMinPoolSize in interface ConnectionPoolMBeanpublic int getFreeConnections()
getFreeConnections in interface ConnectionPoolMBeanpublic int getUsedConnections()
getUsedConnections in interface ConnectionPoolMBeanpublic int getTotalConnections()
getTotalConnections in interface ConnectionPoolMBeanpublic long getConnPoolTimeout()
getConnPoolTimeout in interface ConnectionPoolMBeanpublic void setConnPoolTimeout(long poolTimeout)
setConnPoolTimeout in interface ConnectionPoolMBeanpublic long getIdleTime()
getIdleTime in interface ConnectionPoolMBeanpublic void setIdleTime(long newIdleTime)
setIdleTime in interface ConnectionPoolMBeanpublic int getRequestQSize()
getRequestQSize in interface ConnectionPoolMBeanpublic void setRequestQSize(int reqSize)
setRequestQSize in interface ConnectionPoolMBeanpublic int getPendingRequests()
getPendingRequests in interface ConnectionPoolMBeanpublic long getTestFrequency()
getTestFrequency in interface ConnectionPoolMBeanpublic long getReconnectFrequency()
getReconnectFrequency in interface ConnectionPoolMBeanpublic long getFailedConnRequest()
getFailedConnRequest in interface ConnectionPoolMBeanpublic long getHighFailedConnRequest()
getHighFailedConnRequest in interface ConnectionPoolMBeanpublic int getHighUsedConnections()
getHighUsedConnections in interface ConnectionPoolMBeanpublic void setTestFrequency(long testFreq)
setTestFrequency in interface ConnectionPoolMBeanpublic void setReconnectFrequency(long reconnFreq)
setReconnectFrequency in interface ConnectionPoolMBeanpublic int getHighFreeCons()
getHighFreeCons in interface ConnectionPoolMBeanpublic int getHighTotalCons()
getHighTotalCons in interface ConnectionPoolMBeanpublic int getHighPendingRequests()
getHighPendingRequests in interface ConnectionPoolMBeanpublic void ReConnectAll()
ReConnectAll in interface ConnectionPoolMBeanprotected void init(java.lang.String connectionURL)
throws EBufException
connectionURL - pcp-type URL (pcp://...)EBufExceptionpublic PortalContext getConnection() throws DeterminateException
DeterminateExceptionpublic void testFreeConnections()
public void releaseConnection(PortalContext connection)
connection - PortalContext Objectpublic void addToFreeConnection(PortalContext connection, long lastUsedTime, java.lang.String descr)
public void releaseBadConnection(PortalContext pc)
pc - PortalContext objectpublic void closeConnection(PortalContext connection, boolean bDecCntFlag)
public int getMaxRequestListSize()
public void setMaxRequestListSize(int reqQSize)
public static ConnectionPool getInstance() throws EBufException
EBufExceptionpublic static void createInstance(ConnectionFactory cf) throws EBufException
cf - ConnectionFactory typeEBufExceptionpublic static void createInstance(ConnectionFactory cf, FList fl) throws EBufException
cf - ConnectionFactory typefl - FList containing login infoEBufExceptionpublic static void createInstance(ConnectionFactory cf, java.util.Properties p) throws EBufException
cf - ConnectionFactory typep - Properties containing the login info and connection pool
settingsEBufExceptionpublic ConnectionFactory getConnectionFactory()
protected java.lang.Object[] createConnections(int size)
throws EBufException,
java.text.ParseException
size - - number of connections to be createdEBufExceptionjava.text.ParseExceptionprotected boolean isIdleConnection(com.portal.pfc.infranet.connpool.ConnectionPool.TimedConnection tc)
protected void closeIdleConnections()
protected void reEstablishAllConnections()
public void resetHighestStats()
public void resetFailCount()
public int getCurrentConnectionCount()
public int getCurrentUsedConnections()
public int getNumberOfPendingRequests()
public int getNumberOfFreeConnections()
public long getConnectionIdleTime()
public void setConnectionIdleTime(long newIdleTime)
public long getTestConnectionFrequency()
public long getReConnFrequency()
public long getNumFailedRequest()
public long getNumHighFailedRequest()
public void setTestConnectionFrequency(long testFreq)
public void setReConnFrequency(long reconFreq)
public long getConnectionTimeOut()
public void setConnectionTimeOut(long poolTimeout)
public int getMaxConnections()
public int getMinConnections()
public void setMaxConnections(int maxConns)
public void setMinConnections(int minConns)
public int getHighestCurConnCount()
public int getHighestFree()
public int getNumHighUsedConnections()
public int getHighestRequestListSize()
public int getLowestHeadroom()