Interface UniversalConnectionPoolManagerMBean
-
public interface UniversalConnectionPoolManagerMBeanThe Universal Connection Pool Manager MBean defines operations and attributes for managing pool instances. Remote users can get access to these operations and attributes using JMX operations. The MBean has access to the Universal Connection Pool Manager and gets the required pool object to start an operation.There is only one Universal Connection Pool Manager MBean for a JVM and this is registered with an MBeanServer.
All the operations implemented on the pool manager MBean are called only when
jmxFlagon the pool manager is set totrue. Default value forjmxFlagistrue. When the MBeanServer is not available,jmxFlagis automatically set tofalse.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UniversalConnectionPoolMBeancreateConnectionPool(UniversalConnectionPoolAdapter ucpAdapter)Creates a connection pool instance based on specified UCP Adapter.voiddestroyConnectionPool(java.lang.String poolName)Destroys the connection pool.java.lang.StringdiagnosticsSummaryPrintout()Gets the diagnostics printout.UniversalConnectionPoolLifeCycleStategetConnectionPoolLifeCycleState(java.lang.String poolName)Gets the life cycle state of the Universal Connection Pool.java.lang.String[]getConnectionPoolNames()Gets all the pool names managed by the Universal Connection Pool Manager.java.util.logging.LevelgetLogLevel()Gets the log level for the logger.java.lang.StringgetMBeanNameForConnectionPool(java.lang.String connectionPoolName)Gets the MBean Name for the corresponding Universal Connection Pool MBean Object.intgetMetricUpdateInterval()Gets the metric update interval value.voidpurgeConnectionPool(java.lang.String poolName)Purges the connection pool.voidreconfigureConnectionPool(java.lang.String poolName, java.util.Properties configuration)Reconfigures the connection pool.voidrecycleConnectionPool(java.lang.String poolName)Recycles the connection pool.voidrefreshConnectionPool(java.lang.String poolName)Refreshes the connection pool.voidregisterUniversalConnectionPoolMBean(UniversalConnectionPoolMBean poolMBean)Registers the Universal Connection Pool MBean instance with the MBean server.voidsetLogLevel(java.util.logging.Level newLogLevel)Sets the log level for the UCP logger.voidsetMetricUpdateInterval(int interval)Sets the metric update interval value.voidstartConnectionPool(java.lang.String poolName)Starts the connection pool.voidstartMetricsCollection(java.lang.String poolName)Starts metric collection for the provided pool.voidstopConnectionPool(java.lang.String poolName)Stops the connection pool.voidstopMetricsCollection(java.lang.String poolName)Stops metric collection for the provided pool.voidunregisterUniversalConnectionPoolMBean(java.lang.String poolName)Unregisters the Universal Connection Pool MBean from the MBean server.
-
-
-
Method Detail
-
startConnectionPool
void startConnectionPool(java.lang.String poolName) throws UniversalConnectionPoolExceptionStarts the connection pool. A connection pool object is obtained from the manager by providingpoolnameas a key. Pool operation is called to start the connection pool.Starting the pool does not start metric collection for the pool. Operation
startMetricsCollectionneeds to be called to start the metric collection for the pool.- Parameters:
poolName- Connection pool name to find the connection pool object from the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while starting the connection pool.
-
stopConnectionPool
void stopConnectionPool(java.lang.String poolName) throws UniversalConnectionPoolExceptionStops the connection pool. Connection pool object is obtained from the manager by providingpoolnameas a key. Pool operation is called to stop the connection pool. Stops the metric collection if it is already started.- Parameters:
poolName- Connection pool name to find the connection pool object from the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while stopping the connection pool.
-
refreshConnectionPool
void refreshConnectionPool(java.lang.String poolName) throws UniversalConnectionPoolExceptionRefreshes the connection pool. Connection pool object is obtained from the manager by providingpoolnameas a key. Pool operation is called to refresh the connection pool.- Parameters:
poolName- Connection pool name to find the connection pool object from the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while refreshing the connection pool.
-
recycleConnectionPool
void recycleConnectionPool(java.lang.String poolName) throws UniversalConnectionPoolExceptionRecycles the connection pool. Connection pool object is obtained from the manager by providingpoolnameas a key. Pool operation is called to recycle the connection pool. This is similar torefresh(), but allows only invalid available connections in the pool to be replaced with new/fresh connections.- Parameters:
poolName- Connection pool name to find the connection pool object from the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while recycling the connection pool.
-
purgeConnectionPool
void purgeConnectionPool(java.lang.String poolName) throws UniversalConnectionPoolExceptionPurges the connection pool. Connection pool object is obtained from the manager by providingpoolnameas a key. Pool operation is called to purge the connection pool.Removes all connections from the connection pool. The primary difference in behavior between this and
refresh()is that the connection pool is left empty with no connections available after callingpurge(). Some of the connection pool properties such asminPoolSizeorinitialPoolSizemay not be honored when purging connections from the pool.- Parameters:
poolName- Connection pool name to find the connection pool object from the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while purging the connection pool.
-
createConnectionPool
UniversalConnectionPoolMBean createConnectionPool(UniversalConnectionPoolAdapter ucpAdapter) throws UniversalConnectionPoolException
Creates a connection pool instance based on specified UCP Adapter. Pool and connection factory configuration properties should be set on the Adapter prior to invoking this method. The created pool instance will be added to this UCP manager.- Parameters:
ucpAdapter- The UCP Adapter for pool creation.- Returns:
- instance of xreated MBean
- Throws:
UniversalConnectionPoolException- If an error occurs while creating the connection pool.
-
destroyConnectionPool
void destroyConnectionPool(java.lang.String poolName) throws UniversalConnectionPoolExceptionDestroys the connection pool. Connection pool object is obtained from the manager by providingpoolnameas a key. Pool operation is called to stop the connection pool. The pool is stopped and removed from the manager.- Parameters:
poolName- Connection pool name to find the connection pool object from the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while destroying the connection pool.
-
reconfigureConnectionPool
void reconfigureConnectionPool(java.lang.String poolName, java.util.Properties configuration) throws UniversalConnectionPoolExceptionReconfigures the connection pool. The connection pool is obtained from the manager by providingpoolNameas key. The following properties are supported in the "configuration" parameter:initialPoolSize,minPoolSize,maxPoolSize,fastConnectionFailoverEnabled,maxIdleTime,maxConnectionReuseCount,maxConnectionReuseTime,maxStatements,abandonedConnectionTimeout,connectionHarvestMaxCount,timeoutCheckInterval,connectionHarvestTriggerCount,inactiveConnectionTimeout,propertyCycle,connectionWaitTimeout,validateConnectionOnBorrow,onsConfiguration,sqlForValidateConnection,timeToLiveConnectionTimeout,loginTimeout,highCostConnectionReuseThreshold,connectionLabelingHighCost,connectionAffinityCallback,connectionInitializationCallback,connectionLabelingCallback,secondsToTrustIdleConnection,connectionRepurposeThreshold.- Parameters:
poolName- Connection pool name registered with the universal connection pool manager.configuration- the configuration input as Properties- Throws:
UniversalConnectionPoolException- If an error occurs while reconfiguring the connection pool.
-
getConnectionPoolNames
java.lang.String[] getConnectionPoolNames() throws UniversalConnectionPoolExceptionGets all the pool names managed by the Universal Connection Pool Manager.- Returns:
- String[] List of connection pool Names, returned as an Array.
- Throws:
UniversalConnectionPoolException- If an error occurs while getting the pool names.
-
startMetricsCollection
void startMetricsCollection(java.lang.String poolName) throws UniversalConnectionPoolExceptionStarts metric collection for the provided pool.- Parameters:
poolName- Connection pool name to find the connection pool object from the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while starting metrics collection.
-
stopMetricsCollection
void stopMetricsCollection(java.lang.String poolName) throws UniversalConnectionPoolExceptionStops metric collection for the provided pool.- Parameters:
poolName- Connection pool name to find the connection pool object from the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while stopping metrics collection.
-
setMetricUpdateInterval
void setMetricUpdateInterval(int interval) throws UniversalConnectionPoolExceptionSets the metric update interval value.- Parameters:
interval- Value for metric update interval in seconds.- Throws:
UniversalConnectionPoolException- If an error occurs while updating metric interval.
-
getMetricUpdateInterval
int getMetricUpdateInterval()
Gets the metric update interval value.- Returns:
- The metric update interval in seconds.
-
registerUniversalConnectionPoolMBean
void registerUniversalConnectionPoolMBean(UniversalConnectionPoolMBean poolMBean) throws UniversalConnectionPoolException
Registers the Universal Connection Pool MBean instance with the MBean server. One MBean is registered for every Universal Connection Pool instance. The MBean is created using the standardRequiredModelMBeanclass during the registration of the Model MBean.- Parameters:
poolMBean- the MBean to register in the MBeanServer.- Throws:
UniversalConnectionPoolException- If an error occurs while registering the MBean.
-
unregisterUniversalConnectionPoolMBean
void unregisterUniversalConnectionPoolMBean(java.lang.String poolName) throws UniversalConnectionPoolExceptionUnregisters the Universal Connection Pool MBean from the MBean server. The MBean is created using the standardRequiredModelMBeanclass during the registration of the Model MBean.- Parameters:
poolName- Pool name to identify the MBean and to unregister it from the MBeanServer.- Throws:
UniversalConnectionPoolException- If an error occurs while unregistering the MBean.
-
getConnectionPoolLifeCycleState
UniversalConnectionPoolLifeCycleState getConnectionPoolLifeCycleState(java.lang.String poolName) throws UniversalConnectionPoolException
Gets the life cycle state of the Universal Connection Pool.- Parameters:
poolName- Connection pool name to find the connection pool object from Universal Connection Pool Manager.- Returns:
- The life cycle state of the connection pool.
- Throws:
UniversalConnectionPoolException- If an error occurs while getting the life cycle state.
-
setLogLevel
void setLogLevel(java.util.logging.Level newLogLevel)
Sets the log level for the UCP logger.- Parameters:
newLogLevel- The new log level to be set for UCP logger.
-
getLogLevel
java.util.logging.Level getLogLevel()
Gets the log level for the logger.- Returns:
- Level Returns the Level object for the Logger.
-
getMBeanNameForConnectionPool
java.lang.String getMBeanNameForConnectionPool(java.lang.String connectionPoolName) throws UniversalConnectionPoolExceptionGets the MBean Name for the corresponding Universal Connection Pool MBean Object.- Parameters:
connectionPoolName- Connection Pool Name for which MBean Name is queried- Returns:
- String Returns the MBean Name String
- Throws:
UniversalConnectionPoolException- in case of inability to get a pool.
-
diagnosticsSummaryPrintout
java.lang.String diagnosticsSummaryPrintout()
Gets the diagnostics printout.- Returns:
- diagnostics printout
-
-