|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.jonas.resource.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,
java.lang.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. |
int |
getBusyMaxRecent()
|
int |
getBusyMinRecent()
|
int |
getConnectionFailures()
|
int |
getConnectionLeaks()
|
int |
getCurrentBusy()
|
int |
getCurrentOpened()
|
int |
getCurrentWaiters()
|
int |
getInitSize()
|
int |
getJdbcConnLevel()
getJdbcConnLevel gets the jdbc connection level |
java.lang.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 |
getOpenedCount()
|
int |
getRejectedFull()
|
int |
getRejectedOpen()
|
int |
getRejectedOther()
|
int |
getRejectedTimeout()
|
java.lang.Object |
getResource(java.lang.Object hints)
getResource is used to allocate a Object from the Pool. |
java.lang.Object |
getResource(java.lang.Object hints,
boolean freeListOnly)
|
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(java.lang.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(java.lang.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 |
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, java.lang.String jndiname)
logger
- Logger for the pool to useMethod Detail |
---|
public 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 initsize) throws java.lang.Exception
Pool
setInitSize
in interface Pool
initsize
- The init size to be created.
java.lang.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 java.lang.String getJdbcTestStatement()
Pool
getJdbcTestStatement
in interface Pool
Pool.getJdbcTestStatement()
public void setJdbcTestStatement(java.lang.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 maxsize) throws java.lang.Exception
Pool
setMaxSize
in interface Pool
maxsize
- int maximum size to be assigned.
java.lang.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 minsize) throws java.lang.Exception
Pool
setMinSize
in interface Pool
minsize
- int minimum size to be assigned.
java.lang.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.Pool.setTimeout(long)
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 java.lang.Object getResource(java.lang.Object hints) throws java.lang.Exception
Pool
getResource
in interface Pool
hints
- Some properties to specialise the matching or the creation
of Object.
java.lang.Exception
- if an error occursPool.getResource(java.lang.Object)
public java.lang.Object getResource(java.lang.Object hints, boolean freeListOnly) throws java.lang.Exception
java.lang.Exception
public void releaseResource(java.lang.Object resource, boolean destroy, boolean adjustment) throws java.lang.Exception
Pool
releaseResource
in interface Pool
resource
- 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
java.lang.Exception
- if an error occursPool.releaseResource(java.lang.Object, boolean, 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.objectweb.jonas.resource.pool.api.PoolMatchFactory)
public void startMonitor()
Pool
startMonitor
in interface Pool
Pool.startMonitor()
public void validateMCs() throws java.lang.Exception
Pool
validateMCs
in interface Pool
java.lang.Exception
- if an error occursPool.validateMCs()
public void adjust() throws java.lang.Exception
adjust
in interface Pool
java.lang.Exception
- if an exception occurspublic void recomputeBusy()
public void sampling() throws java.lang.Exception
Pool
sampling
in interface Pool
java.lang.Exception
- if an error occursPool.sampling()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |