Package oracle.ucp.admin
Interface UniversalConnectionPoolManager
- All Known Implementing Classes:
oracle.ucp.admin.UniversalConnectionPoolManagerBase,UniversalConnectionPoolManagerImpl
public interface UniversalConnectionPoolManager
The UniversalConnectionPoolManager interface defines operations for creating and
maintaining the Universal Connection Pool instances. A pool instance is
registered with the pool manager every time a new pool is created. All the
pool operations can be called by providing the pool name as a key.
Operations for controlling the metric collection for individual Universal
Connection Pool instances are also provided.
The jmxFlag property on
UniversalConnectionPoolManager determines the
availability of JMX support. The default value for jmxFlag is
true. The jmxFlag property is automatically set
to false when the MBeanServer is not available.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateConnectionPool(UniversalConnectionPoolAdapter ucpAdapter) Creates a connection pool instance based on specified UCP Adapter.voiddestroyConnectionPool(String poolName) Destroys the connection pool.getConnectionPool(String poolName) Gets the Universal Connection Pool instance from the Universal Connection Pool Manager.String[]Gets all the pool names managed by the Universal Connection Pool Manager.Gets the log level for the logger.intGets the metric update interval value.booleanDetermines the JMX availability.voidpurgeConnectionPool(String poolName) Purges the connection pool.voidreconfigureConnectionPool(String poolName, Properties configuration) Reconfigures the connection pool.voidrecycleConnectionPool(String poolName) Recycles the connection pool.voidrefreshConnectionPool(String poolName) Refreshes the connection pool.voidsetConnectionPool(UniversalConnectionPool connectionPool) Sets the Universal Connection Pool with theUniversalConnectionPoolManagerObject.voidsetJmxEnabled(boolean jmxFlag) Sets thejmxFlagto eithertrueorfalse.voidsetLogLevel(Level newLogLevel) Sets the log level for the UCP logger.voidsetMetricUpdateInterval(int interval) Sets the metric update interval value.voidstartConnectionPool(String poolName) Starts the connection pool instance with the given name.voidstartMetricsCollection(String poolName) Starts metric collection for the provided pool.voidstopConnectionPool(String poolName) Stops the connection pool.voidstopMetricsCollection(String poolName) Stops metric collection for the provided pool.
-
Method Details
-
startConnectionPool
Starts the connection pool instance with the given name.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 for identifying the pool instance registered with the pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while starting the connection pool.
-
stopConnectionPool
Stops the connection pool. Connection pool object is obtained from the manager by providing pool name as 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
Refreshes the connection pool. Connection pool object is obtained from the manager by providingpoolnameas key. Pool operation is called to refresh the connection pool.- Parameters:
poolName- Connection pool name to find the connection pool object from pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while refreshing the connection pool.
-
recycleConnectionPool
Recycles the connection pool. Connection pool object is obtained from the manager by providingpoolnameas 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 pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while recycling the connection pool.
-
purgeConnectionPool
Purges the connection pool. Connection pool object is obtained from the manager by providingpoolnameas 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 pool manager.- Throws:
UniversalConnectionPoolException- If an error occurs while purging the connection pool.
-
createConnectionPool
void 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.- Throws:
UniversalConnectionPoolException- If an error occurs while creating the connection pool.
-
destroyConnectionPool
Destroys the connection pool. The connection pool is obtained from the manager by providingpoolnameas key. Pool operation is called to stop the connection pool. Pool will be 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(String poolName, Properties configuration) throws UniversalConnectionPoolException Reconfigures 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,minIdlemaxPoolSize,fastConnectionFailoverEnabled,maxIdleTime,maxConnectionReuseCount,maxConnectionReuseTime,maxStatements,abandonedConnectionTimeout,connectionHarvestMaxCount,timeoutCheckInterval,connectionHarvestTriggerCount,inactiveConnectionTimeout,propertyCycle,connectionWaitTimeout,validateConnectionOnBorrow,onsConfiguration,sqlForValidateConnection,timeToLiveConnectionTimeout,loginTimeout,highCostConnectionReuseThreshold,connectionLabelingHighCost,connectionAffinityCallback,connectionInitializationCallback,connectionCreationConsumer,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.
-
setConnectionPool
void setConnectionPool(UniversalConnectionPool connectionPool) throws UniversalConnectionPoolException Sets the Universal Connection Pool with theUniversalConnectionPoolManagerObject. Once the pool is stored, it can be maintained with the operations provided on the pool manager.- Parameters:
connectionPool- TheUniversalConnectionPoolobject to be maintained by the Universal Connection Pool Manager.- Throws:
UniversalConnectionPoolException- If an error occurs while storing theUniversalConnectionPoolobject with the Universal Connection Pool Manager.
-
getConnectionPool
Gets the Universal Connection Pool instance from the Universal Connection Pool Manager.- Parameters:
poolName- Connection pool name to get the Universal Connection Pool instance.- Returns:
- pool's instance.
- Throws:
UniversalConnectionPoolException- If an error occurs while getting the Universal Connection Pool instance.
-
getConnectionPoolNames
Gets 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
Starts 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
Stops 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
Sets 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.
-
setJmxEnabled
Sets thejmxFlagto eithertrueorfalse.- Parameters:
jmxFlag- Flag indicating whether JMX is enabled or not.- Throws:
UniversalConnectionPoolException- If an error occurs while settingjmxFlag.
-
isJmxEnabled
boolean isJmxEnabled()Determines the JMX availability.- Returns:
trueif JMX is enabled; otherwisefalse.
-
setLogLevel
Sets the log level for the UCP logger.- Parameters:
newLogLevel- The new log level to be set for UCP logger.
-
getLogLevel
Level getLogLevel()Gets the log level for the logger.- Returns:
- Level Returns the Level object for the Logger.
-