|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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,
String jndiname)
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)
Get a Resource from the freelist, matching hints. |
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)
Remove Resource from activeList |
void |
sampling()
sampling updates the interval pool information |
void |
setInitSize(int v)
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 val)
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 val)
setMinSize assigns a minimum size to this Pool. |
void |
setObservable(boolean obs)
Set the pool 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, String jndiname)
logger
- Logger for the pool to usejndiname
- jndi name of the RAMethod Detail |
---|
public void setObservable(boolean obs)
setObservable
in interface Pool
obs
- = true if keep stack traces at openpublic int getCurrentBusy()
getCurrentBusy
in interface Pool
public int getCurrentOpened()
getCurrentOpened
in interface Pool
public int getInitSize()
getInitSize
in interface Pool
Pool.getInitSize()
public void setInitSize(int v) throws Exception
Pool
setInitSize
in interface Pool
v
- The init size to be created.
Exception
- if an error occursPool.setInitSize(int)
public int getJdbcConnLevel()
Pool
getJdbcConnLevel
in interface Pool
Pool.getJdbcConnLevel()
public void setJdbcConnLevel(int jdbcConnLevel)
Pool
setJdbcConnLevel
in interface Pool
jdbcConnLevel
- int JDBC connection levelPool.setJdbcConnLevel(int)
public String getJdbcTestStatement()
Pool
getJdbcTestStatement
in interface Pool
Pool.getJdbcTestStatement()
public void setJdbcTestStatement(String jdbcTestStatement)
Pool
setJdbcTestStatement
in interface Pool
jdbcTestStatement
- String JDBC test statementPool.setJdbcTestStatement(java.lang.String)
public int getMaxAge()
Pool
getMaxAge
in interface Pool
Pool.getMaxAge()
public void setMaxAge(int maxAge)
Pool
setMaxAge
in interface Pool
maxAge
- int max number of minutes to keep a connection
in the pool.Pool.setMaxAge(int)
public int getMaxOpentime()
Pool
getMaxOpentime
in interface Pool
public void setMaxOpentime(int mx)
Pool
setMaxOpentime
in interface Pool
mx
- max time of open connection in minutespublic int getMaxSize()
Pool
getMaxSize
in interface Pool
Pool.getMaxSize()
public void setMaxSize(int val) throws Exception
Pool
setMaxSize
in interface Pool
val
- int maximum size to be assigned.
Exception
- if an error occursPool.setMaxSize(int)
public int getMaxWaiters()
Pool
getMaxWaiters
in interface Pool
public void setMaxWaiters(int nb)
Pool
setMaxWaiters
in interface Pool
nb
- max nb of waiterspublic int getMaxWaitTime()
Pool
getMaxWaitTime
in interface Pool
public void setMaxWaitTime(int sec)
Pool
setMaxWaitTime
in interface Pool
sec
- max time to wait for a connection, in secondspublic int getMinSize()
Pool
getMinSize
in interface Pool
Pool.getMinSize()
public void setMinSize(int val) throws Exception
Pool
setMinSize
in interface Pool
val
- int minimum size to be assigned.
Exception
- if an error occursPool.setMinSize(int)
public int getSamplingPeriod()
Pool
getSamplingPeriod
in interface Pool
public void setSamplingPeriod(int sec)
Pool
setSamplingPeriod
in interface Pool
sec
- sampling period in sec.public int getSize()
getSize
in interface Pool
public long getTimeout()
Pool
getTimeout
in interface Pool
Pool.getTimeout()
public void setTimeout(long crto)
Pool
setTimeout
in interface Pool
crto
- long timeout to be assigned.not used
public int getBusyMaxRecent()
getBusyMaxRecent
in interface Pool
public int getBusyMinRecent()
getBusyMinRecent
in interface Pool
public int getCurrentWaiters()
getCurrentWaiters
in interface Pool
public int getOpenedCount()
getOpenedCount
in interface Pool
public int getConnectionFailures()
getConnectionFailures
in interface Pool
public int getConnectionLeaks()
getConnectionLeaks
in interface Pool
public int getServedOpen()
getServedOpen
in interface Pool
public int getRejectedFull()
getRejectedFull
in interface Pool
public int getRejectedTimeout()
getRejectedTimeout
in interface Pool
public int getRejectedOther()
getRejectedOther
in interface Pool
public int getRejectedOpen()
getRejectedOpen
in interface Pool
public int getWaitersHigh()
getWaitersHigh
in interface Pool
public int getWaitersHighRecent()
getWaitersHighRecent
in interface Pool
public int getWaiterCount()
getWaiterCount
in interface Pool
public long getWaitingTime()
getWaitingTime
in interface Pool
public long getWaitingHigh()
getWaitingHigh
in interface Pool
public long getWaitingHighRecent()
getWaitingHighRecent
in interface Pool
public Object getResource(Object hints) throws Exception
getResource
in interface Pool
hints
-
Exception
- cannot get a ResourcePool.getResource(java.lang.Object)
public void releaseResource(Object resource, boolean destroy) throws Exception
releaseResource
in interface Pool
resource
- ManagedConnection to be releaseddestroy
- true if do not keep it in freeList
Exception
- if an error occursPool.releaseResource(java.lang.Object, boolean)
public void closeAllConnections()
closeAllConnections
in interface Pool
public PoolMatchFactory getMatchFactory()
Pool
getMatchFactory
in interface Pool
Pool.getMatchFactory()
public void setMatchFactory(PoolMatchFactory pmf)
Pool
setMatchFactory
in interface Pool
pmf
- The PoolMatchFactory to be assigned.Pool.setMatchFactory(org.ow2.jonas.resource.internal.pool.PoolMatchFactory)
public void startMonitor()
Pool
startMonitor
in interface Pool
Pool.startMonitor()
public int[] getOpenedConnections(long usedTimeMs)
getOpenedConnections
in interface Pool
usedTimeMs
- nb of milliseconds the Connection has been opened
public void forceCloseConnection(int connectionId)
forceCloseConnection
in interface Pool
connectionId
- int that represent the Connectionpublic ManagedConnection getConnectionById(int connectionId)
Pool
getConnectionById
in interface Pool
connectionId
- Ident that represent the connection
public Map getConnectionDetails(ManagedConnection res, Transaction tx)
Pool
getConnectionDetails
in interface Pool
res
- the connectiontx
- Transaction associated to this Connection, or null.
public void validateMCs() throws Exception
Pool
validateMCs
in interface Pool
Exception
- if an error occursPool.validateMCs()
public void adjust() throws Exception
adjust
in interface Pool
Exception
- if an exception occurspublic void recomputeBusy()
public void sampling() throws Exception
Pool
sampling
in interface Pool
Exception
- if an error occursPool.sampling()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |