|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas.resource.pool.lib.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. |
int |
getBusyMaxRecent()
|
int |
getBusyMinRecent()
|
int |
getConnectionFailures()
|
int |
getConnectionLeaks()
|
int |
getCurrentBusy()
|
int |
getCurrentOpened()
|
int |
getCurrentWaiters()
|
int |
getInitSize()
|
PoolMatchFactory |
getMatchFactory()
getMatchFactory retrieves the PoolMatchFactory assigned to this Pool. |
long |
getMaxAge()
|
long |
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. |
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 |
setMatchFactory(PoolMatchFactory pmf)
setMatchFactory assigns a PoolMatchFactory to this Pool. |
void |
setMaxAge(long maxAge)
setMaxAge sets the max age for a pool entry |
void |
setMaxOpentime(long mx)
setMaxOpentime sets the max age for a pool entry |
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)
logger
- Logger for the pool to useMethod Detail |
public int getCurrentBusy()
public int getCurrentOpened()
public int getInitSize()
org.objectweb.jonas.resource.pool.api.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 long getMaxAge()
org.objectweb.jonas.resource.pool.api.Pool#getMaxAge
public void setMaxAge(long maxAge)
Pool
setMaxAge
in interface Pool
maxAge
- long max number of milliseconds to keep a connection
in the pool.Pool.setMaxAge(long)
public long getMaxOpentime()
Pool
getMaxOpentime
in interface Pool
public void setMaxOpentime(long mx)
Pool
setMaxOpentime
in interface Pool
mx
- max time of open connection in millisecondspublic 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()
public int getBusyMinRecent()
public int getCurrentWaiters()
public int getOpenedCount()
public int getConnectionFailures()
public int getConnectionLeaks()
public int getServedOpen()
public int getRejectedFull()
public int getRejectedTimeout()
public int getRejectedOther()
public int getRejectedOpen()
public int getWaitersHigh()
public int getWaitersHighRecent()
public int getWaiterCount()
public long getWaitingTime()
public long getWaitingHigh()
public long getWaitingHighRecent()
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 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 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 |