|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Pool
The interface Pool defines an object that pools resources of any kind. Resources must be requested (getResource) and released (releaseResource) on demand. A Pool object can be parameterized along different dimensions. All these dimensions are represented by accessor methods (getters and setters) assigned to each of them:
Method Summary | |
---|---|
void |
adjust()
adjust checks the age of the entries and removes them if they are too old |
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 mc,
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()
getSize retrieves the current size of this Pool. |
long |
getTimeout()
getTimeout retrieves the timeout assigned to this Pool. |
int |
getWaiterCount()
|
int |
getWaitersHigh()
|
int |
getWaitersHighRecent()
|
long |
getWaitingHigh()
|
long |
getWaitingHighRecent()
|
long |
getWaitingTime()
|
void |
releaseResource(Object resource,
boolean destroy)
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 maxOpentime)
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 maxWaiters)
setMaxWaiters sets the maximum number of waiters for a connection in this Pool. |
void |
setMaxWaitTime(int maxWaitTime)
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 obs)
Set the pool observable |
void |
setSamplingPeriod(int samplingPeriod)
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 |
Method Detail |
---|
void adjust() throws Exception
Exception
- if an error occursvoid closeAllConnections()
int getJdbcConnLevel()
String getJdbcTestStatement()
PoolMatchFactory getMatchFactory()
int getMaxAge()
int getMaxOpentime()
int getMaxSize()
int getMaxWaiters()
int getMaxWaitTime()
int getMinSize()
Object getResource(Object hints) throws Exception
hints
- Some properties to specialise the matching or the creation
of Object.
Exception
- if an error occursint getSamplingPeriod()
long getTimeout()
int getSize()
int getInitSize()
void releaseResource(Object resource, boolean destroy) throws Exception
resource
- The Object to be released.destroy
- boolean to remove the object from the pool and
destroy it
Exception
- if an error occursvoid sampling() throws Exception
Exception
- if an error occursvoid setInitSize(int initsize) throws Exception
initsize
- The init size to be created.
Exception
- if an error occursvoid setJdbcConnLevel(int jdbcConnLevel)
jdbcConnLevel
- int JDBC connection levelvoid setJdbcTestStatement(String jdbcTestStatement)
jdbcTestStatement
- String JDBC test statementvoid setMatchFactory(PoolMatchFactory pmf)
pmf
- The PoolMatchFactory to be assigned.void setMaxAge(int maxAge)
maxAge
- int max number of minutes to keep a connection
in the pool.void setMaxOpentime(int maxOpentime)
maxOpentime
- int max number of minutes to keep a connection
opened.void setMaxSize(int maxsize) throws Exception
maxsize
- int maximum size to be assigned.
Exception
- if an error occursvoid setMaxWaiters(int maxWaiters)
maxWaiters
- int maximum number of waitersvoid setMaxWaitTime(int maxWaitTime)
maxWaitTime
- int maximum number of seconds to waitvoid setMinSize(int minsize) throws Exception
minsize
- int minimum size to be assigned.
Exception
- if an error occursvoid setSamplingPeriod(int samplingPeriod)
samplingPeriod
- int number of seconds between samplingsvoid setTimeout(long crto)
crto
- long timeout to be assigned.void startMonitor()
void validateMCs() throws Exception
Exception
- if an error occursint getCurrentBusy()
int getCurrentOpened()
int getBusyMaxRecent()
int getBusyMinRecent()
int getCurrentWaiters()
int getOpenedCount()
int getConnectionFailures()
int getConnectionLeaks()
int getServedOpen()
int getRejectedFull()
int getRejectedTimeout()
int getRejectedOther()
int getRejectedOpen()
int getWaitersHigh()
int getWaitersHighRecent()
int getWaiterCount()
long getWaitingTime()
long getWaitingHigh()
long getWaitingHighRecent()
void forceCloseConnection(int connectionId)
connectionId
- int that represent the Connectionint[] getOpenedConnections(long usedTimeMs)
usedTimeMs
- nb of milliseconds the Connection has been opened
ManagedConnection getConnectionById(int connectionId)
connectionId
- Ident that represent the connection
Map getConnectionDetails(ManagedConnection mc, Transaction tx)
mc
- the connectiontx
- Transaction associated to this Connection, or null.
void setObservable(boolean obs)
obs
- = true if keep stack traces at open
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |