public interface JDBCResourceConnectionPoolManagementMBean
The JDBCResourceConnectionPoolManagementMBean
interface provides methods to modify the configuration settings of a JDBC resource’s connection pool.
The JMX Object Name of a JDBCResourceConnectionPoolManagementMBean
can be obtained from a PersistenceManagementMBean
.
Modifier and Type | Field and Description |
---|---|
static String |
MBEAN_NAME
The name of MBeans of this type, equal to the string "JdbcResourceConnectionPool".
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Notify the SLEE that the
JDBCResourceConnectionPoolManagementMBean is no longer required by the management client. |
CompositeData |
getConfiguration()
Get a description of the connection pool configuration.
|
long |
getConnectionPoolTimeout()
Get the connection pool timeout.
|
int |
getIdleCheckInterval()
Get the time between idle connection discard checks.
|
int |
getMaxConnections()
Get the maximum total number of connections that can exist at any one time.
|
int |
getMaxIdleConnections()
Get the maximum number of idle connections that can exist at any one time.
|
int |
getMaxIdleTime()
Get the time a connection can be idle for before becoming eligible for discard.
|
int |
getMinConnections()
Get the minimum total number of connections that should exist at any one time.
|
void |
setConnectionPoolTimeout(long timeout)
Set the connection pool timeout.
|
void |
setIdleCheckInterval(int idleCheckInterval)
Set the time between idle connection discard checks.
|
void |
setMaxConnections(int maxConnections)
Set the maximum total number of connections that can exist at any one time.
|
void |
setMaxIdleConnections(int maxIdleConnections)
Set the maximum number of idle connections that can exist at any one time.
|
void |
setMaxIdleTime(int maxIdleTime)
Set the time period after which an idle connection may become eligible for discard.
|
void |
setMinConnections(int minConnections)
Set the minimum total number of connections that should exist at any one time.
|
void |
setParameters(Map<String,Object> parameters)
Bulk set a number of connection pool configuration parameters.
|
static final String MBEAN_NAME
The name of MBeans of this type, equal to the string "JdbcResourceConnectionPool".
int getMaxConnections() throws ConfigurationException
Get the maximum total number of connections that can exist at any one time.
ConfigurationException
- if the operation fails due to a configuration error.void setMaxConnections(int maxConnections) throws ConfigurationException
Set the maximum total number of connections that can exist at any one time. This includes pooled, establishing, and in-use connections.
maxConnections
- the maximum total number of connections.
This value must be greater than 0 and greater than or equal to getMaxIdleConnections()
.ConfigurationException
- if the operation fails due to a configuration error.int getMinConnections() throws ConfigurationException
Get the minimum total number of connections that should exist at any one time.
ConfigurationException
- if the operation fails due to a configuration error.void setMinConnections(int minConnections) throws ConfigurationException
Set 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.
minConnections
- the minimum total number of connections that should exist.. This value must be at least 0 and less than or equal to getMaxIdleConnections()
.ConfigurationException
- if the operation fails due to a configuration error.int getMaxIdleConnections() throws ConfigurationException
Get the maximum number of idle connections that can exist at any one time.
ConfigurationException
- if the operation fails due to a configuration error.void setMaxIdleConnections(int maxIdleConnections) throws ConfigurationException
Set 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.
maxIdleConnections
- the maximum number of idle connections.
This value must be at least 0, less than or equal to getMaxConnections()
, and greater than or equal to getMinConnections()
ConfigurationException
- if the operation fails due to a configuration error.int getMaxIdleTime() throws ConfigurationException
Get the time a connection can be idle for before becoming eligible for discard.
ConfigurationException
- if the operation fails due to a configuration error.void setMaxIdleTime(int maxIdleTime) throws ConfigurationException
Set 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()
.
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.ConfigurationException
- if the operation fails due to a configuration error.int getIdleCheckInterval() throws ConfigurationException
Get the time between idle connection discard checks.
This value only has meaning if getMaxIdleTime()
is greater than 0.
ConfigurationException
- if the operation fails due to a configuration error.void setIdleCheckInterval(int idleCheckInterval) throws ConfigurationException
Set the time between idle connection discard checks.
This value only has meaning if getMaxIdleTime()
is greater than 0.
idleCheckInterval
- the idle connection discard check period, measured in seconds.
This value must be greater than 0.ConfigurationException
- if the operation fails due to a configuration error.long getConnectionPoolTimeout() throws ConfigurationException
Get the connection pool timeout.
ConfigurationException
- if the operation fails due to a configuration error.void setConnectionPoolTimeout(long timeout) throws ConfigurationException
Set the connection pool timeout. This value is the maximum time that a SLEE application requesting a connection will block before a timeout error occurs.
timeout
- the connection pool timeout, measured in milliseconds.
This value must be greater than or equal to 0.ConfigurationException
- if the operation fails due to a configuration error.void setParameters(Map<String,Object> parameters) throws ConfigurationException
Bulk set a number of connection pool configuration parameters.
The parameters
argument 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
- a map of the configuration to set, as given above.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.CompositeData getConfiguration() throws ConfigurationException
Get a description of the connection pool configuration.
The CompositeData
object 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.
ConfigurationException
- if the operation fails due to a configuration error.void close() throws ConfigurationException
Notify the SLEE that the JDBCResourceConnectionPoolManagementMBean
is 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.
ConfigurationException
- if the operation fails due to a system-level failure.