Package org.hippoecm.hst.core.jcr.pool
Interface PoolingRepositoryMBean
- All Known Subinterfaces:
PoolingRepository
public interface PoolingRepositoryMBean
PoolingRepositoryMBean
- Version:
- $Id$
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The key name of the counter which counts session activation.static final String
The key name of the counter which counts session creation.static final String
The key name of the counter which counts session destroying.static final String
The key name of the counter which counts session obtained by login.static final String
The key name of the counter which counts session passivation.static final String
The key name of the counter which counts session returned by logout.static final String
When the sessions in the pool are exhausted, the pool will be blocked for the specified interval to wait for available idle session.static final String
When the sessions in the pool are exhausted, the pool will throw exception instantly without waiting for available idle session.static final String
When the sessions in the pool are exhausted, the pool will grow the action session count to serve the request. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears any sessions sitting idle in the pool by removing them from the idle instance pool.void
close()
Closes the poolint
Returns the initial size of the connection pool.int
Returns the maximum number of active connections that can be allocated at the same time.int
Returns the maximum number of connections that can remain idle in the pool.long
Returns the maximum number of milliseconds that the pool will wait for a connection to be returned before throwing an exception.long
Returns the the minimum amount of time an object may sit idle in the poolint
Returns the minimum number of idle connections in the poolint
Returns the current active session count in the pool.int
Returns the current idle session count in the pool.int
Returns the number of objects to examine during idle object evictor runsboolean
Returns whether objects are validated before being borrowed from the poolboolean
Returns whether objects are validated before being returned to the poolboolean
Returns whether objects examined by the idle object evictor are validatedlong
Returns the time (in miliseconds) between evictor runsReturns the validation query used to validate connections.Returns the action when the pool is exhausted returning them.void
Initializes the poolvoid
setInitialSize
(int initialSize) Sets the initial size of the connection pool.void
setMaxActive
(int maxActive) Sets the maximum number of active connections that can be allocated at the same time.void
setMaxIdle
(int maxIdle) Sets the maximum number of connections that can remain idle in the pool.void
setMaxWait
(long maxWait) Sets the maxWait property.void
setMinEvictableIdleTimeMillis
(long minEvictableIdleTimeMillis) Sets the the minimum amount of time an object may sit idle in the poolvoid
setMinIdle
(int minIdle) Sets the minimum number of idle connections in the pool.void
setNumTestsPerEvictionRun
(int numTestsPerEvictionRun) Sets the number of objects to examine during idle object evictor runsvoid
setTestOnBorrow
(boolean testOnBorrow) Sets whether or not the pool will validate objects before they are borrowed from the pool.void
setTestOnReturn
(boolean testOnReturn) Sets whether or not the pool will validate objects before they are returned to the pool.void
setTestWhileIdle
(boolean testWhileIdle) Sets whether or not the idle object evictor will validate connections.void
setTimeBetweenEvictionRunsMillis
(long timeBetweenEvictionRunsMillis) Sets the time (in miliseconds) between evictor runsvoid
setValidationQuery
(String validationQuery) Sets the validation query used to validate connections.void
setWhenExhaustedAction
(String whenExhaustedAction) Sets the action when the pool is exhausted returning them.
-
Field Details
-
WHEN_EXHAUSTED_BLOCK
When the sessions in the pool are exhausted, the pool will be blocked for the specified interval to wait for available idle session.- See Also:
-
WHEN_EXHAUSTED_FAIL
When the sessions in the pool are exhausted, the pool will throw exception instantly without waiting for available idle session.- See Also:
-
WHEN_EXHAUSTED_GROW
When the sessions in the pool are exhausted, the pool will grow the action session count to serve the request. This option will make the max active count limit meaningless.- See Also:
-
COUNTER_SESSION_CREATED
The key name of the counter which counts session creation.- See Also:
-
COUNTER_SESSION_ACTIVATED
The key name of the counter which counts session activation.- See Also:
-
COUNTER_SESSION_OBTAINED
The key name of the counter which counts session obtained by login.- See Also:
-
COUNTER_SESSION_RETURNED
The key name of the counter which counts session returned by logout.- See Also:
-
COUNTER_SESSION_PASSIVATED
The key name of the counter which counts session passivation.- See Also:
-
COUNTER_SESSION_DESTROYED
The key name of the counter which counts session destroying.- See Also:
-
-
Method Details
-
initialize
Initializes the pool- Throws:
Exception
-
clear
void clear()Clears any sessions sitting idle in the pool by removing them from the idle instance pool. -
close
Closes the pool- Throws:
Exception
-
getNumActive
int getNumActive()Returns the current active session count in the pool. -
getNumIdle
int getNumIdle()Returns the current idle session count in the pool. -
getInitialSize
int getInitialSize()Returns the initial size of the connection pool. -
setInitialSize
void setInitialSize(int initialSize) Sets the initial size of the connection pool.- Parameters:
initialSize
- the number of connections created when the pool is initialized
-
getMaxActive
int getMaxActive()Returns the maximum number of active connections that can be allocated at the same time. -
setMaxActive
void setMaxActive(int maxActive) Sets the maximum number of active connections that can be allocated at the same time. Use a negative value for no limit.- Parameters:
maxActive
- the new value for maxActive- See Also:
-
getMaxIdle
int getMaxIdle()Returns the maximum number of connections that can remain idle in the pool. -
setMaxIdle
void setMaxIdle(int maxIdle) Sets the maximum number of connections that can remain idle in the pool.- Parameters:
maxIdle
- the new value for maxIdle- See Also:
-
getMinIdle
int getMinIdle()Returns the minimum number of idle connections in the pool -
setMinIdle
void setMinIdle(int minIdle) Sets the minimum number of idle connections in the pool.- Parameters:
minIdle
- the new value for minIdle
-
getMaxWait
long getMaxWait()Returns the maximum number of milliseconds that the pool will wait for a connection to be returned before throwing an exception.A value less than or equal to zero means the pool is set to wait indefinitely.
- Returns:
- the maxWait property value
-
setMaxWait
void setMaxWait(long maxWait) Sets the maxWait property.Use -1 to make the pool wait indefinitely.
- Parameters:
maxWait
- the new value for maxWait- See Also:
-
getMinEvictableIdleTimeMillis
long getMinEvictableIdleTimeMillis()Returns the the minimum amount of time an object may sit idle in the pool -
setMinEvictableIdleTimeMillis
void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) Sets the the minimum amount of time an object may sit idle in the pool -
getNumTestsPerEvictionRun
int getNumTestsPerEvictionRun()Returns the number of objects to examine during idle object evictor runs -
setNumTestsPerEvictionRun
void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) Sets the number of objects to examine during idle object evictor runs -
getTestOnBorrow
boolean getTestOnBorrow()Returns whether objects are validated before being borrowed from the pool- See Also:
-
setTestOnBorrow
void setTestOnBorrow(boolean testOnBorrow) Sets whether or not the pool will validate objects before they are borrowed from the pool. For atrue
value to have any effect,getValidationQuery()
must return a non-null string.- Parameters:
testOnBorrow
- new value for testOnBorrow property
-
getTestOnReturn
boolean getTestOnReturn()Returns whether objects are validated before being returned to the pool- See Also:
-
setTestOnReturn
void setTestOnReturn(boolean testOnReturn) Sets whether or not the pool will validate objects before they are returned to the pool. For atrue
value to have any effect, thegetValidationQuery()
must return a non-null string.- Parameters:
testOnReturn
- new value for testOnReturn property
-
getTestWhileIdle
boolean getTestWhileIdle()Returns whether objects examined by the idle object evictor are validated- See Also:
-
setTestWhileIdle
void setTestWhileIdle(boolean testWhileIdle) Sets whether or not the idle object evictor will validate connections. For atrue
value to have any effect, thegetValidationQuery()
must return a non-null string.- Parameters:
testWhileIdle
- new value for testWhileIdle property
-
getTimeBetweenEvictionRunsMillis
long getTimeBetweenEvictionRunsMillis()Returns the time (in miliseconds) between evictor runs- See Also:
-
setTimeBetweenEvictionRunsMillis
void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) Sets the time (in miliseconds) between evictor runs- Parameters:
timeBetweenEvictionRunsMillis
- the new time between evictor runs- See Also:
-
getValidationQuery
String getValidationQuery()Returns the validation query used to validate connections.- Returns:
- the JCR validation query
- See Also:
-
setValidationQuery
Sets the validation query used to validate connections.- Parameters:
validationQuery
- the new value for the JCR validation query
-
getWhenExhaustedAction
String getWhenExhaustedAction()Returns the action when the pool is exhausted returning them.- Returns:
- the action when the pool is exhausted
- See Also:
-
setWhenExhaustedAction
Sets the action when the pool is exhausted returning them.- Parameters:
whenExhaustedAction
- the new value for the action when the pool is exhausted
-