Interface JDBCResourceConnectionPoolManagementMBean
-
public interface JDBCResourceConnectionPoolManagementMBeanThe
JDBCResourceConnectionPoolManagementMBeaninterface provides methods to modify the configuration settings of a JDBC resource’s connection pool.The JMX Object Name of a
JDBCResourceConnectionPoolManagementMBeancan be obtained from aPersistenceManagementMBean.- Since:
- Rhino 2.5.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringMBEAN_NAMEThe name of MBeans of this type, equal to the string "JdbcResourceConnectionPool".
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Notify the SLEE that theJDBCResourceConnectionPoolManagementMBeanis no longer required by the management client.CompositeDatagetConfiguration()Get a description of the connection pool configuration.longgetConnectionPoolTimeout()Get the connection pool timeout.intgetIdleCheckInterval()Get the time between idle connection discard checks.intgetMaxConnections()Get the maximum total number of connections that can exist at any one time.intgetMaxIdleConnections()Get the maximum number of idle connections that can exist at any one time.intgetMaxIdleTime()Get the time a connection can be idle for before becoming eligible for discard.intgetMinConnections()Get the minimum total number of connections that should exist at any one time.voidsetConnectionPoolTimeout(long timeout)Set the connection pool timeout.voidsetIdleCheckInterval(int idleCheckInterval)Set the time between idle connection discard checks.voidsetMaxConnections(int maxConnections)Set the maximum total number of connections that can exist at any one time.voidsetMaxIdleConnections(int maxIdleConnections)Set the maximum number of idle connections that can exist at any one time.voidsetMaxIdleTime(int maxIdleTime)Set the time period after which an idle connection may become eligible for discard.voidsetMinConnections(int minConnections)Set the minimum total number of connections that should exist at any one time.voidsetParameters(Map<String,Object> parameters)Bulk set a number of connection pool configuration parameters.
-
-
-
Field Detail
-
MBEAN_NAME
static final String MBEAN_NAME
The name of MBeans of this type, equal to the string "JdbcResourceConnectionPool".
- Since:
- Rhino 2.5.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMaxConnections
int getMaxConnections() throws ConfigurationExceptionGet the maximum total number of connections that can exist at any one time.
- Returns:
- the maximum total number of connections that can exist.
- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
setMaxConnections
void setMaxConnections(int maxConnections) throws ConfigurationExceptionSet the maximum total number of connections that can exist at any one time. This includes pooled, establishing, and in-use connections.
- Parameters:
maxConnections- the maximum total number of connections. This value must be greater than 0 and greater than or equal togetMaxIdleConnections().- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
getMinConnections
int getMinConnections() throws ConfigurationExceptionGet the minimum total number of connections that should exist at any one time.
- Returns:
- the minimum total number of connections.
- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
setMinConnections
void setMinConnections(int minConnections) throws ConfigurationExceptionSet the minimum total number of connections that should exist at any one time. The idle connection pool will be initially populated with this many connections. The total number of in-use and idle connections will (generally) never decrease below the value set for this property.
- Parameters:
minConnections- the minimum total number of connections that should exist.. This value must be at least 0 and less than or equal togetMaxIdleConnections().- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
getMaxIdleConnections
int getMaxIdleConnections() throws ConfigurationExceptionGet the maximum number of idle connections that can exist at any one time.
- Returns:
- the maximum number of idle connections.
- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
setMaxIdleConnections
void setMaxIdleConnections(int maxIdleConnections) throws ConfigurationExceptionSet the maximum number of idle connections that can exist at any one time. In-use connections that become idle when there are already this number of idle connections will be discarded.
- Parameters:
maxIdleConnections- the maximum number of idle connections. This value must be at least 0, less than or equal togetMaxConnections(), and greater than or equal togetMinConnections()- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
getMaxIdleTime
int getMaxIdleTime() throws ConfigurationExceptionGet the time a connection can be idle for before becoming eligible for discard.
- Returns:
- the maximum idle time, measured in seconds.
- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
setMaxIdleTime
void setMaxIdleTime(int maxIdleTime) throws ConfigurationExceptionSet the time period after which an idle connection may become eligible for discard. Note that an idle connection will not be discarded if it would reduce the number of idle connections below
getMinConnections().- Parameters:
maxIdleTime- the maximum idle time, measured in seconds. This value must be at least 0, with 0 meaning that idle connections will never be discarded for this reason.- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
getIdleCheckInterval
int getIdleCheckInterval() throws ConfigurationExceptionGet the time between idle connection discard checks. This value only has meaning if
getMaxIdleTime()is greater than 0.- Returns:
- the idle connection discard check period, measured in seconds.
- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
setIdleCheckInterval
void setIdleCheckInterval(int idleCheckInterval) throws ConfigurationExceptionSet the time between idle connection discard checks. This value only has meaning if
getMaxIdleTime()is greater than 0.- Parameters:
idleCheckInterval- the idle connection discard check period, measured in seconds. This value must be greater than 0.- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
getConnectionPoolTimeout
long getConnectionPoolTimeout() throws ConfigurationExceptionGet the connection pool timeout.
- Returns:
- the connection pool timeout, measured in milliseconds.
- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
setConnectionPoolTimeout
void setConnectionPoolTimeout(long timeout) throws ConfigurationExceptionSet the connection pool timeout. This value is the maximum time that a SLEE application requesting a connection will block before a timeout error occurs.
- Parameters:
timeout- the connection pool timeout, measured in milliseconds. This value must be greater than or equal to 0.- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
setParameters
void setParameters(Map<String,Object> parameters) throws ConfigurationException
Bulk set a number of connection pool configuration parameters.
The
parametersargument is a map who’s keys are property names (case insensitive) and values are the values to be assigned to the corresponding property. The legal property names and the expected type of their respective property value are given in the table below:Property name (case insensitive) Property value type max-connections
java.lang.Integer
min-connections
java.lang.Integer
max-idle-connections
java.lang.Integer
max-idle-time
java.lang.Integer
idle-check-interval
java.lang.Integer
connection-pool-timeout
java.lang.Long
- Parameters:
parameters- a map of the configuration to set, as given above.- Throws:
ConfigurationException- if an unrecognised configuration parameter is included, a configuration parameter is given an invalid value, the final set of configuration properties fails a validation check, or the operation fails due to an internal configuration error.- Since:
- Rhino 2.5.0
-
getConfiguration
CompositeData getConfiguration() throws ConfigurationException
Get a description of the connection pool configuration.
The
CompositeDataobject returned by this method has the following structure:Field
Open Type
Description
max-connections
Integer
The value returned from the
getMaxConnections()method.min-connections
Integer
The value returned from the
getMinConnections()method.max-idle-connections
Integer
The value returned from the
getMaxIdleConnections()method.max-idle-time
Integer
The value returned from the
getMaxIdleTime()method.idle-check-interval
Integer
The value returned from the
getIdleCheckInterval()method.connection-pool-timeout
Long
The value returned from the
getConnectionPoolTimeout()method.- Returns:
- a JMX composite data object as described above.
- Throws:
ConfigurationException- if the operation fails due to a configuration error.- Since:
- Rhino 2.5.0
-
close
void close() throws ConfigurationExceptionNotify the SLEE that the
JDBCResourceConnectionPoolManagementMBeanis no longer required by the management client. As the SLEE may subsequently deregister the MBean from the MBean server, a client that invokes this method should assume that the Object Name they had for the MBean is no longer valid once this method returns.- Throws:
ConfigurationException- if the operation fails due to a system-level failure.- Since:
- Rhino 2.5.0
-
-