public class ConnectionPool extends 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,
Properties p)
Constructor that reads in Connectionpool-specific properties info from a
properties object
|
ConnectionPool(ConnectionFactory cf,
Properties p,
int timeOut)
Constructor that reads in Connectionpool-specific properties info from a
properties object.
|
ConnectionPool(String host,
String port,
String user,
String password,
String service)
Constructor that takes a set of connection related properties.
|
Modifier and Type | Method and Description |
---|---|
void |
addToFreeConnection(PortalContext connection,
long lastUsedTime,
String descr) |
void |
closeConnection(PortalContext connection,
boolean bDecCntFlag) |
protected void |
closeIdleConnections()
Closes any idle connections in the free-connection list.
|
protected 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,
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(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 setEBufException
public ConnectionPool(ConnectionFactory cf, Properties p) throws EBufException
cf
- ConnectionFactory type to be usedp
- Properties objectEBufException
public ConnectionPool(ConnectionFactory cf, FList connFL) throws EBufException
cf
- ConnectionFactory type to be usedconnFL
- connection FListEBufException
public ConnectionPool(String host, String port, String user, String password, String service) throws EBufException
host
- port
- user
- password
- service
- EBufException
public ConnectionPool(ConnectionFactory cf, Properties p, int timeOut) throws EBufException
cf
- p
- timeOut
- value in millisecondsEBufException
public void setMaxPoolSize(int maxPoolSize)
setMaxPoolSize
in interface ConnectionPoolMBean
public int getMaxPoolSize()
getMaxPoolSize
in interface ConnectionPoolMBean
public void setMinPoolSize(int minPoolSize)
setMinPoolSize
in interface ConnectionPoolMBean
public int getMinPoolSize()
getMinPoolSize
in interface ConnectionPoolMBean
public int getFreeConnections()
getFreeConnections
in interface ConnectionPoolMBean
public int getUsedConnections()
getUsedConnections
in interface ConnectionPoolMBean
public int getTotalConnections()
getTotalConnections
in interface ConnectionPoolMBean
public long getConnPoolTimeout()
getConnPoolTimeout
in interface ConnectionPoolMBean
public void setConnPoolTimeout(long poolTimeout)
setConnPoolTimeout
in interface ConnectionPoolMBean
public long getIdleTime()
getIdleTime
in interface ConnectionPoolMBean
public void setIdleTime(long newIdleTime)
setIdleTime
in interface ConnectionPoolMBean
public int getRequestQSize()
getRequestQSize
in interface ConnectionPoolMBean
public void setRequestQSize(int reqSize)
setRequestQSize
in interface ConnectionPoolMBean
public int getPendingRequests()
getPendingRequests
in interface ConnectionPoolMBean
public long getTestFrequency()
getTestFrequency
in interface ConnectionPoolMBean
public long getReconnectFrequency()
getReconnectFrequency
in interface ConnectionPoolMBean
public long getFailedConnRequest()
getFailedConnRequest
in interface ConnectionPoolMBean
public long getHighFailedConnRequest()
getHighFailedConnRequest
in interface ConnectionPoolMBean
public int getHighUsedConnections()
getHighUsedConnections
in interface ConnectionPoolMBean
public void setTestFrequency(long testFreq)
setTestFrequency
in interface ConnectionPoolMBean
public void setReconnectFrequency(long reconnFreq)
setReconnectFrequency
in interface ConnectionPoolMBean
public int getHighFreeCons()
getHighFreeCons
in interface ConnectionPoolMBean
public int getHighTotalCons()
getHighTotalCons
in interface ConnectionPoolMBean
public int getHighPendingRequests()
getHighPendingRequests
in interface ConnectionPoolMBean
public void ReConnectAll()
ReConnectAll
in interface ConnectionPoolMBean
protected void init(String connectionURL) throws EBufException
connectionURL
- pcp-type URL (pcp://...)EBufException
public PortalContext getConnection() throws DeterminateException
DeterminateException
public void testFreeConnections()
public void releaseConnection(PortalContext connection)
connection
- public void addToFreeConnection(PortalContext connection, long lastUsedTime, String descr)
public void releaseBadConnection(PortalContext pc)
PortalContext
- public void closeConnection(PortalContext connection, boolean bDecCntFlag)
public int getMaxRequestListSize()
public void setMaxRequestListSize(int reqQSize)
public static ConnectionPool getInstance() throws EBufException
EBufException
public static void createInstance(ConnectionFactory cf) throws EBufException
cf
- ConnectionFactory typeEBufException
public static void createInstance(ConnectionFactory cf, FList fl) throws EBufException
cf
- ConnectionFactory typefl
- FList containing login infoEBufException
public static void createInstance(ConnectionFactory cf, Properties p) throws EBufException
cf
- ConnectionFactory typep
- Properties containing the login info and connection pool
settingsEBufException
public ConnectionFactory getConnectionFactory()
protected Object[] createConnections(int size) throws EBufException, ParseException
size
- - number of connections to be createdEBufException
ParseException
protected 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()
Copyright © 2003, 2023, Oracle and/or its affiliates.