|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jonas.resource.internal.pool.lib.HArrayPool
public class HArrayPool
The class HArrayPool implements a Pool as a HashSet of ManagedConnections, managing free/active resources. Updated to use an LRU list of free resources Author: Eric HARDESTY
| Constructor Summary | |
|---|---|
HArrayPool(org.objectweb.util.monolog.api.Logger logger)
HArrayPool constructor |
|
| Method Summary | |
|---|---|
void |
adjust()
Adjust the pool size, according to poolMax and minSize values. |
void |
closeAllConnections()
Close all connections in the pool when server is shutting down. |
void |
forceCloseConnection(int connectionId)
force the close of the Connection identified by ots Id |
int |
getBusyMaxRecent()
|
int |
getBusyMinRecent()
|
ManagedConnection |
getConnectionById(int connectionId)
Return the ManagedConnection identified by this Id |
Map |
getConnectionDetails(ManagedConnection res,
Transaction tx)
Return a Map with details about a Connection |
int |
getConnectionFailures()
|
int |
getConnectionLeaks()
|
int |
getCurrentBusy()
|
int |
getCurrentOpened()
|
int |
getCurrentWaiters()
|
int |
getInitSize()
|
int |
getJdbcConnLevel()
getJdbcConnLevel gets the jdbc connection level |
String |
getJdbcTestStatement()
getJdbcTestStatement gets the JDBC test statement for this pool |
PoolMatchFactory |
getMatchFactory()
getMatchFactory retrieves the PoolMatchFactory assigned to this Pool. |
int |
getMaxAge()
getMaxAge gets the max age for a pool entry |
int |
getMaxOpentime()
getMaxOpentime gets the max age for a pool entry |
int |
getMaxSize()
getMaxSize retrieves the maximum size assigned to this Pool. |
int |
getMaxWaiters()
getMaxWaiters gets the maximum number of waiters for a connection in this Pool. |
int |
getMaxWaitTime()
getMaxWaitTime gets the maximum number of seconds to wait for a connection in this Pool. |
int |
getMinSize()
getMinSize retrieves the minimum size assigned to this Pool. |
int[] |
getOpenedConnections(long usedTimeMs)
return a list of idents that represent the connections opened for a given nb of seconds |
int |
getOpenedCount()
|
int |
getRejectedFull()
|
int |
getRejectedOpen()
|
int |
getRejectedOther()
|
int |
getRejectedTimeout()
|
Object |
getResource(Object hints)
getResource is used to allocate a Object from the Pool. |
int |
getSamplingPeriod()
getSamplingPeriod gets the number of seconds between statistics sampling for this Pool. |
int |
getServedOpen()
|
int |
getSize()
Get the size of the pool |
long |
getTimeout()
getTimeout retrieves the timeout assigned to this Pool. |
int |
getWaiterCount()
|
int |
getWaitersHigh()
|
int |
getWaitersHighRecent()
|
long |
getWaitingHigh()
|
long |
getWaitingHighRecent()
|
long |
getWaitingTime()
|
void |
recomputeBusy()
compute current min/max busyConnections |
void |
releaseResource(Object resource,
boolean destroy,
boolean adjustment)
releaseResource releases a Object in order to allow the Pool to recycle this Object. |
void |
sampling()
sampling updates the interval pool information |
void |
setInitSize(int initsize)
setInitSize creates initsize resoures to this Pool. |
void |
setJdbcConnLevel(int jdbcConnLevel)
setJdbcConnLevel sets the JDBC connection level for this pool |
void |
setJdbcTestStatement(String jdbcTestStatement)
setJdbcTestStatement sets the JDBC test statement for this pool |
void |
setMatchFactory(PoolMatchFactory pmf)
setMatchFactory assigns a PoolMatchFactory to this Pool. |
void |
setMaxAge(int maxAge)
setMaxAge sets the max age for a pool entry |
void |
setMaxOpentime(int mx)
setMaxOpentime sets the max age for an entry to be opened |
void |
setMaxSize(int maxsize)
setMaxSize assigns a maximum size to this Pool. |
void |
setMaxWaiters(int nb)
setMaxWaiters sets the maximum number of waiters for a connection in this Pool. |
void |
setMaxWaitTime(int sec)
setMaxWaitTime sets the maximum number of seconds to wait for a connection in this Pool. |
void |
setMinSize(int minsize)
setMinSize assigns a minimum size to this Pool. |
void |
setObservable(boolean observable)
Sets observable. |
void |
setSamplingPeriod(int sec)
setSamplingPeriod sets the number of seconds between statistics sampling for this Pool. |
void |
setTimeout(long crto)
setTimeout assigns a timeout to this Pool. |
void |
startMonitor()
startMonitor starts the pool monitor for this Pool. |
void |
validateMCs()
validateMCs validates ManagedConnections in Pool every 10 minutes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HArrayPool(org.objectweb.util.monolog.api.Logger logger)
logger - Logger for the pool to use| Method Detail |
|---|
public int getCurrentBusy()
getCurrentBusy in interface Poolpublic int getCurrentOpened()
getCurrentOpened in interface Poolpublic int getInitSize()
getInitSize in interface PoolPool.getInitSize()
public void setInitSize(int initsize)
throws Exception
Pool
setInitSize in interface Poolinitsize - The init size to be created.
Exception - if an error occursPool.setInitSize(int)public int getJdbcConnLevel()
Pool
getJdbcConnLevel in interface PoolPool.getJdbcConnLevel()public void setJdbcConnLevel(int jdbcConnLevel)
Pool
setJdbcConnLevel in interface PooljdbcConnLevel - int JDBC connection levelPool.setJdbcConnLevel(int)public String getJdbcTestStatement()
Pool
getJdbcTestStatement in interface PoolPool.getJdbcTestStatement()public void setJdbcTestStatement(String jdbcTestStatement)
Pool
setJdbcTestStatement in interface PooljdbcTestStatement - String JDBC test statementPool.setJdbcTestStatement(java.lang.String)public int getMaxAge()
Pool
getMaxAge in interface PoolPool.getMaxAge()public void setMaxAge(int maxAge)
Pool
setMaxAge in interface PoolmaxAge - int max number of minutes to keep a connection
in the pool.Pool.setMaxAge(int)public int getMaxOpentime()
Pool
getMaxOpentime in interface Poolpublic void setMaxOpentime(int mx)
Pool
setMaxOpentime in interface Poolmx - max time of open connection in minutespublic int getMaxSize()
Pool
getMaxSize in interface PoolPool.getMaxSize()
public void setMaxSize(int maxsize)
throws Exception
Pool
setMaxSize in interface Poolmaxsize - int maximum size to be assigned.
Exception - if an error occursPool.setMaxSize(int)public int getMaxWaiters()
Pool
getMaxWaiters in interface Poolpublic void setMaxWaiters(int nb)
Pool
setMaxWaiters in interface Poolnb - max nb of waiterspublic int getMaxWaitTime()
Pool
getMaxWaitTime in interface Poolpublic void setMaxWaitTime(int sec)
Pool
setMaxWaitTime in interface Poolsec - max time to wait for a connection, in secondspublic int getMinSize()
Pool
getMinSize in interface PoolPool.getMinSize()
public void setMinSize(int minsize)
throws Exception
Pool
setMinSize in interface Poolminsize - int minimum size to be assigned.
Exception - if an error occursPool.setMinSize(int)public int getSamplingPeriod()
Pool
getSamplingPeriod in interface Poolpublic void setSamplingPeriod(int sec)
Pool
setSamplingPeriod in interface Poolsec - sampling period in sec.public int getSize()
getSize in interface Poolpublic long getTimeout()
Pool
getTimeout in interface PoolPool.getTimeout()public void setTimeout(long crto)
Pool
setTimeout in interface Poolcrto - long timeout to be assigned.Pool.setTimeout(long)public int getBusyMaxRecent()
getBusyMaxRecent in interface Poolpublic int getBusyMinRecent()
getBusyMinRecent in interface Poolpublic int getCurrentWaiters()
getCurrentWaiters in interface Poolpublic int getOpenedCount()
getOpenedCount in interface Poolpublic int getConnectionFailures()
getConnectionFailures in interface Poolpublic int getConnectionLeaks()
getConnectionLeaks in interface Poolpublic int getServedOpen()
getServedOpen in interface Poolpublic int getRejectedFull()
getRejectedFull in interface Poolpublic int getRejectedTimeout()
getRejectedTimeout in interface Poolpublic int getRejectedOther()
getRejectedOther in interface Poolpublic int getRejectedOpen()
getRejectedOpen in interface Poolpublic int getWaitersHigh()
getWaitersHigh in interface Poolpublic int getWaitersHighRecent()
getWaitersHighRecent in interface Poolpublic int getWaiterCount()
getWaiterCount in interface Poolpublic long getWaitingTime()
getWaitingTime in interface Poolpublic long getWaitingHigh()
getWaitingHigh in interface Poolpublic long getWaitingHighRecent()
getWaitingHighRecent in interface Pool
public Object getResource(Object hints)
throws Exception
Pool
getResource in interface Poolhints - Some properties to specialise the matching or the creation
of Object.
Exception - if an error occursPool.getResource(java.lang.Object)
public void releaseResource(Object resource,
boolean destroy,
boolean adjustment)
throws Exception
Pool
releaseResource in interface Poolresource - The Object to be released.destroy - boolean to remove the object from the pool and
destroy itadjustment - boolean to determine if a pool adjustment should be done
Exception - if an error occursPool.releaseResource(java.lang.Object, boolean, boolean)public void closeAllConnections()
closeAllConnections in interface Poolpublic PoolMatchFactory getMatchFactory()
Pool
getMatchFactory in interface PoolPool.getMatchFactory()public void setMatchFactory(PoolMatchFactory pmf)
Pool
setMatchFactory in interface Poolpmf - The PoolMatchFactory to be assigned.Pool.setMatchFactory(org.ow2.jonas.resource.internal.pool.PoolMatchFactory)public void startMonitor()
Pool
startMonitor in interface PoolPool.startMonitor()
public void validateMCs()
throws Exception
Pool
validateMCs in interface PoolException - if an error occursPool.validateMCs()public int[] getOpenedConnections(long usedTimeMs)
getOpenedConnections in interface PoolusedTimeMs - nb of milliseconds the Connection has been opened
public void forceCloseConnection(int connectionId)
forceCloseConnection in interface PoolconnectionId - int that represent the Connectionpublic ManagedConnection getConnectionById(int connectionId)
Pool
getConnectionById in interface PoolconnectionId - Ident that represent the connection
public Map getConnectionDetails(ManagedConnection res,
Transaction tx)
Pool
getConnectionDetails in interface Poolres - the connectiontx - Transaction associated to this Connection, or null.
public void adjust()
throws Exception
adjust in interface PoolException - if an exception occurspublic void recomputeBusy()
public void setObservable(boolean observable)
setObservable in interface Poolobservable - the boolean value
public void sampling()
throws Exception
Pool
sampling in interface PoolException - if an error occursPool.sampling()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||