public class DataSourceRuntimeMBeanImpl extends RuntimeMBeanDelegate implements JDBCDataSourceRuntimeMBean
Modifier and Type | Class and Description |
---|---|
private class |
DataSourceRuntimeMBeanImpl.OperationRequest |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
beanName |
protected java.lang.String |
databaseProductName |
protected java.lang.String |
databaseProductVersion |
private java.lang.String |
defaultForConnectionMetadata |
protected java.lang.String |
driverName |
private JDBCDriverRuntimeMBean |
driverRTMBean |
protected java.lang.String |
driverVersion |
protected weblogic.common.resourcepool.ResourcePoolGroup |
group |
(package private) JDBCDataSourceTaskRuntimeMBeanImpl |
lastTask |
private java.sql.DatabaseMetaData |
metaData |
private java.util.concurrent.locks.ReentrantLock |
metaDataLock |
protected boolean |
needMetaData |
protected JDBCConnectionPool |
pool |
static java.lang.String |
PROGRESS_FAILED |
static java.lang.String |
PROGRESS_PROCESSING |
static java.lang.String |
PROGRESS_SUCCESS |
private JDBCReplayStatisticsRuntimeMBean |
replayStatisticsRuntimeMBean |
private static int |
TASK_AFTERLIFE_TIME_MILLIS |
private java.util.Set<JDBCDataSourceTaskRuntimeMBeanImpl> |
tasks |
descriptor, name, parent, registered, type
ACTIVATED, NEW, PREPARED, UNPREPARED, UPDATE_PENDING
Constructor and Description |
---|
DataSourceRuntimeMBeanImpl(JDBCConnectionPool pool,
weblogic.common.resourcepool.ResourcePoolGroup group,
java.lang.String beanName,
RuntimeMBean parent,
RuntimeMBean restParent,
DescriptorBean descriptor) |
DataSourceRuntimeMBeanImpl(JDBCConnectionPool pool,
java.lang.String beanName,
RuntimeMBean parent,
RuntimeMBean restParent,
DescriptorBean descriptor) |
Modifier and Type | Method and Description |
---|---|
boolean |
addWorkManagerRuntime(WorkManagerRuntimeMBean wmRuntime)
Adds the RuntimeMBean for a WorkManager defined in this component
|
private void |
clearCachedValues() |
void |
clearOldTaskRuntimes() |
void |
clearStatementCache()
Clears the cache of Prepared and Callable Statements maintained
for each connection in the pool.
|
private void |
doOperation(boolean shutdown,
int operationSecs,
JDBCDataSourceTaskRuntimeMBeanImpl task) |
void |
dumpPool()
Prints out information about all the connections in the
connection pool in the data source.
|
void |
dumpPoolProfile()
Prints out profile information about the data source.
|
void |
forceShutdown()
Forcefully shuts down a data source that has a health state of
Running ,
including forcing the disconnection of all current connection users. |
void |
forceSuspend()
Forcefully suspends a data source that has the health state of
Running , including disconnecting all current connection
users. |
int |
getActiveConnectionsAverageCount()
Average number of active connections in this instance of the data source.
|
int |
getActiveConnectionsCurrentCount()
Returns the current total active connections.
|
int |
getActiveConnectionsHighCount()
Returns the high water mark of active connections in this DataSourceRuntimeMBean.
|
long |
getCommitOutcomeRetryTotalCount()
The cumulative total number of commit outcome query retries
conducted before resolving the outcome or exceeding the retry seconds
in this data source since the data source was deployed.
|
int |
getConnectionDelayTime()
Returns averaged time necessary to get a connection
from the database.
|
int |
getConnectionsTotalCount()
Returns the total number of JDBC connections in this
DataSourceRuntimeMBean since the pool is instantiated.
|
int |
getCurrCapacity()
The current count of JDBC connections in the connection pool in the data source.
|
int |
getCurrCapacityHighCount()
Highest number of database connections available or in use (current capacity)
in this instance of the data source since the data source was deployed.
|
java.lang.String |
getDatabaseProductName()
The product name of the database that this data source is connected
to.
|
java.lang.String |
getDatabaseProductVersion()
The product version of the database that this data source is
connected to.
|
int |
getDeploymentState()
The current deployment state of the
module.
|
java.lang.String |
getDriverName()
The product name of the JDBC driver that this data source is
configured to use.
|
java.lang.String |
getDriverVersion()
The version of the JDBC driver that this data source is configured
to use.
|
long |
getFailedRepurposeCount()
The number of repurpose errors that have occurred since the datasource was deployed.
|
long |
getFailedReserveRequestCount()
The cumulative, running count of requests for a connection from this data source
that could not be fulfilled.
|
int |
getFailuresToReconnectCount()
Returns number of cases when a connection pool
attempted to refresh a connection to a database
and failed.
|
int |
getHighestNumAvailable()
Highest number of database connections that were idle and available
to be used by an application at any time
in this instance of the data source since the data source was deployed.
|
int |
getHighestNumUnavailable()
Highest number of database connections that were
in use by applications or being tested by the system
in this instance of the data source since the data source was deployed.
|
JDBCDriverRuntimeMBean |
getJDBCDriverRuntime()
Gets the JDBCDriverRuntimeMBean associated with this data source.
|
JDBCReplayStatisticsRuntimeMBean |
getJDBCReplayStatisticsRuntimeMBean()
Get the statistics for replay only if the datasource is using an Oracle
replay driver for 12.1.0.2 and later.
|
JDBCDataSourceTaskRuntimeMBean |
getLastTask()
Get the last datasource Task
|
int |
getLeakedConnectionCount()
Returns number of leaked connections.
|
private void |
getMetaData() |
java.lang.String |
getModuleId()
Returns the identifier for this Component.
|
int |
getNumAvailable()
The number of database connections that are currently idle and available to be
used by applications in this instance of the data source.
|
int |
getNumUnavailable()
The number of connections currently in use by applications
or being tested in this instance of the data source.
|
long |
getPrepStmtCacheAccessCount()
The cumulative, running count of the number of times that the statement cache was accessed.
|
long |
getPrepStmtCacheAddCount()
The cumulative, running count of the number of statements added to the statement cache.
|
int |
getPrepStmtCacheCurrentSize()
The number of prepared and callable statements currently cached in the statement cache.
|
long |
getPrepStmtCacheDeleteCount()
The cumulative, running count of statements discarded from the cache.
|
int |
getPrepStmtCacheHitCount()
Returns frequency of use of prepared statements cache -
a cumulative, running count of the use of each cached statement
|
int |
getPrepStmtCacheMissCount()
Returns number of cases the cache does not satisfy
the statement - a similar count (with SQL) of cases
when the cache does not have a cached statement to
satisfy a request.
|
java.util.Properties |
getProperties()
Return the properties for a pool.
|
long |
getRepurposeCount()
The number of times connections have been repurposed since the datasource was deployed.
|
long |
getReserveRequestCount()
The cumulative, running count of requests for a connection from this data source.
|
long |
getResolvedAsCommittedTotalCount()
The cumulative total number of commit outcomes successfully
resolved as committed in this data source since the data source was deployed.
|
long |
getResolvedAsNotCommittedTotalCount()
The cumulative total number of commit outcomes successfully
resolved as not committed in this data source since the data source was deployed.
|
java.lang.String |
getState()
Returns state of the pool.
|
JDBCDataSourceTaskRuntimeMBean[] |
getTasks()
Get preexisting DataSource Tasks
|
long |
getUnresolvedTotalCount()
The cumulative total number of commit outcomes unsuccessfully
resolved in this data source since the data source was deployed.
|
java.lang.String |
getVersionJDBCDriver()
Returns the version of the JDBC driver, in the format of
concatenating the Driver class name with 'major: XX, minor: YY'.
|
int |
getWaitingForConnectionCurrentCount()
Returns the current total waiting for a connection.
|
long |
getWaitingForConnectionFailureTotal()
The cumulative, running count of requests for a connection from this data source
that had to wait before getting a connection and eventually failed to get a connection.
|
int |
getWaitingForConnectionHighCount()
Returns the high water mark of waiters for a connection in this DataSourceRuntimeMBean.
|
long |
getWaitingForConnectionSuccessTotal()
The cumulative, running count of requests for a connection from this data source
that had to wait before getting a connection and eventually succeeded in getting a connection.
|
long |
getWaitingForConnectionTotal()
The cumulative, running count of requests for a connection from this data source
that had to wait before getting a connection, including those that eventually
got a connection and those that did not get a connection.
|
int |
getWaitSecondsHighCount()
Returns the number of seconds the longest waiter for a connection waited
|
WorkManagerRuntimeMBean[] |
getWorkManagerRuntimes()
Get the runtime mbeans for all work managers defined in this component
|
boolean |
isEnabled()
Returns true if the pool enabled.
|
boolean |
isOperationAllowed(java.lang.String operation)
Indicates whether the specified operation is valid based on the state of
the underlying DataSource.
|
protected void |
lookupMetaData() |
boolean |
poolExists(java.lang.String poolName)
Does a pool with the given name exist?
|
void |
reset()
Resets the connection pool in the data source by shutting down and
recreating all available database connections in the pool.
|
void |
resetStatistics()
Reset statistics counters to zero.
|
void |
resume()
Restores all access to and operations on a data source that has a health state of
Suspended . |
void |
setDeploymentState(int state)
Sets the value of the deploymentState attribute.
|
void |
setJDBCDriverRuntime(JDBCDriverRuntimeMBean mbean)
Sets the JDBCDriverRuntimeMBean associated with this data source.
|
private JDBCDataSourceTaskRuntimeMBeanImpl |
setTask(boolean shutdown) |
void |
shrink()
Shrinks the database connection pool in the data source to either
the current number of reserved connections or the initial size of the connection pool,
which ever is greater.
|
void |
shutdown()
Gracefully, synchronously shuts down a data source that has a health
state of
Running . |
JDBCDataSourceTaskRuntimeMBean |
shutdown(int operationSecs)
Gracefully, asynchronously shuts down a data source that has a health
state of
Running . |
void |
start()
Starts a data source that has a health state of
Shutdown . |
void |
suspend()
Synchronously, gracefully suspends a data source that has the health
state of
Running and disables existing connections. |
JDBCDataSourceTaskRuntimeMBean |
suspend(int operationSecs)
Asynchronously, gracefully suspends a data source that has the health
state of
Running and disables existing connections. |
java.lang.String |
testPool()
Tests the connection pool in the data source by reserving and releasing
a connection from it.
|
private void |
throwGroupOperationUnsupported() |
_createHelper, _postSet, _postSet, _postSet, _postSet, _postSet, addChild, addNotificationListener, addPropertyChangeListener, createChildCopy, getAttribute, getAttributes, getMBeanInfo, getMetaData, getName, getNotificationInfo, getObjectName, getParent, getParentAttribute, getPropertyChangeListeners, getRegistrationManager, getRestParent, getType, invoke, isCachingDisabled, isEditable, isRegistered, pluralize, postDeregister, postRegister, preDeregister, preRegister, register, removeChild, removeNotificationListener, removePropertyChangeListener, setAttribute, setAttributes, setMetaData, setName, setParent, setRestParent, setRuntimeMBeanHelper, setType, unregister
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, preDeregister, removePropertyChangeListener
getMBeanInfo, getName, getObjectName, getParent, getType, isCachingDisabled, isRegistered, setName, setParent
getAttribute, getAttributes, invoke, setAttribute, setAttributes
public static final java.lang.String PROGRESS_SUCCESS
public static final java.lang.String PROGRESS_FAILED
public static final java.lang.String PROGRESS_PROCESSING
protected JDBCConnectionPool pool
protected weblogic.common.resourcepool.ResourcePoolGroup group
private JDBCDriverRuntimeMBean driverRTMBean
private java.util.concurrent.locks.ReentrantLock metaDataLock
private java.sql.DatabaseMetaData metaData
private java.lang.String beanName
private JDBCReplayStatisticsRuntimeMBean replayStatisticsRuntimeMBean
private java.util.Set<JDBCDataSourceTaskRuntimeMBeanImpl> tasks
private static final int TASK_AFTERLIFE_TIME_MILLIS
JDBCDataSourceTaskRuntimeMBeanImpl lastTask
private final java.lang.String defaultForConnectionMetadata
protected java.lang.String driverVersion
protected java.lang.String databaseProductName
protected java.lang.String databaseProductVersion
protected java.lang.String driverName
protected volatile boolean needMetaData
public DataSourceRuntimeMBeanImpl(JDBCConnectionPool pool, java.lang.String beanName, RuntimeMBean parent, RuntimeMBean restParent, DescriptorBean descriptor) throws ManagementException
ManagementException
public DataSourceRuntimeMBeanImpl(JDBCConnectionPool pool, weblogic.common.resourcepool.ResourcePoolGroup group, java.lang.String beanName, RuntimeMBean parent, RuntimeMBean restParent, DescriptorBean descriptor) throws ManagementException
ManagementException
public int getDeploymentState()
ComponentRuntimeMBean
The current deployment state of the module.
A module can be in one and only one of the following states. State can be changed via deployment or administrator console.
getDeploymentState
in interface ComponentRuntimeMBean
ComponentRuntimeMBean.setDeploymentState(int)
public void setDeploymentState(int state)
ComponentRuntimeMBean
Sets the value of the deploymentState attribute.
setDeploymentState
in interface ComponentRuntimeMBean
state
- The new deploymentState valueComponentRuntimeMBean.getDeploymentState()
public boolean addWorkManagerRuntime(WorkManagerRuntimeMBean wmRuntime)
ComponentRuntimeMBean
Adds the RuntimeMBean for a WorkManager defined in this component
addWorkManagerRuntime
in interface ComponentRuntimeMBean
public WorkManagerRuntimeMBean[] getWorkManagerRuntimes()
ComponentRuntimeMBean
Get the runtime mbeans for all work managers defined in this component
getWorkManagerRuntimes
in interface ComponentRuntimeMBean
public java.lang.String getModuleId()
ComponentRuntimeMBean
Returns the identifier for this Component. The identifier is unique within the application.
Typical modules will use the URI for their id. Web Modules will return their context-root since the web-uri may not be unique within an EAR.
getModuleId
in interface ComponentRuntimeMBean
public java.lang.String testPool()
JDBCDataSourceRuntimeMBean
Tests the connection pool in the data source by reserving and releasing a connection from it.
If the pool configuration attribute TestConnectionsOnReserve is enabled, the acquired connection is also tested as part of the reserve operation.
testPool
in interface JDBCDataSourceRuntimeMBean
weblogic.management.configuration.JDBCConnectionPoolMBean
public int getLeakedConnectionCount()
getLeakedConnectionCount
in interface JDBCDataSourceRuntimeMBean
public boolean isEnabled()
isEnabled
in interface JDBCDataSourceRuntimeMBean
public java.lang.String getState()
getState
in interface JDBCDataSourceRuntimeMBean
public int getFailuresToReconnectCount()
getFailuresToReconnectCount
in interface JDBCDataSourceRuntimeMBean
public int getConnectionDelayTime()
getConnectionDelayTime
in interface JDBCDataSourceRuntimeMBean
public long getPrepStmtCacheAccessCount()
JDBCDataSourceRuntimeMBean
The cumulative, running count of the number of times that the statement cache was accessed.
getPrepStmtCacheAccessCount
in interface JDBCDataSourceRuntimeMBean
public long getPrepStmtCacheAddCount()
JDBCDataSourceRuntimeMBean
The cumulative, running count of the number of statements added to the statement cache.
Each connection in the connection pool has its own cache of statements. This number is the sum of the number of statements added to the caches for all connections in the connection pool.
getPrepStmtCacheAddCount
in interface JDBCDataSourceRuntimeMBean
public long getPrepStmtCacheDeleteCount()
JDBCDataSourceRuntimeMBean
The cumulative, running count of statements discarded from the cache.
Each connection in the connection pool has its own cache of statements. This number is the sum of the number of statements that were discarded from the caches for all connections in the connection pool.
getPrepStmtCacheDeleteCount
in interface JDBCDataSourceRuntimeMBean
public int getPrepStmtCacheCurrentSize()
JDBCDataSourceRuntimeMBean
The number of prepared and callable statements currently cached in the statement cache.
Each connection in the connection pool has its own cache of statements. This number is the sum of the number of statements in the caches for all connections in the connection pool.
getPrepStmtCacheCurrentSize
in interface JDBCDataSourceRuntimeMBean
public int getPrepStmtCacheHitCount()
getPrepStmtCacheHitCount
in interface JDBCDataSourceRuntimeMBean
public int getPrepStmtCacheMissCount()
getPrepStmtCacheMissCount
in interface JDBCDataSourceRuntimeMBean
public int getActiveConnectionsCurrentCount()
getActiveConnectionsCurrentCount
in interface JDBCDataSourceRuntimeMBean
public int getWaitingForConnectionCurrentCount()
getWaitingForConnectionCurrentCount
in interface JDBCDataSourceRuntimeMBean
public java.lang.String getVersionJDBCDriver()
getVersionJDBCDriver
in interface JDBCDataSourceRuntimeMBean
public int getActiveConnectionsHighCount()
getActiveConnectionsHighCount
in interface JDBCDataSourceRuntimeMBean
public int getWaitingForConnectionHighCount()
getWaitingForConnectionHighCount
in interface JDBCDataSourceRuntimeMBean
public long getWaitingForConnectionTotal()
JDBCDataSourceRuntimeMBean
The cumulative, running count of requests for a connection from this data source that had to wait before getting a connection, including those that eventually got a connection and those that did not get a connection.
getWaitingForConnectionTotal
in interface JDBCDataSourceRuntimeMBean
public long getWaitingForConnectionSuccessTotal()
JDBCDataSourceRuntimeMBean
The cumulative, running count of requests for a connection from this data source that had to wait before getting a connection and eventually succeeded in getting a connection.
getWaitingForConnectionSuccessTotal
in interface JDBCDataSourceRuntimeMBean
public long getWaitingForConnectionFailureTotal()
JDBCDataSourceRuntimeMBean
The cumulative, running count of requests for a connection from this data source that had to wait before getting a connection and eventually failed to get a connection.
Waiting connection requests can fail for a variety of reasons, including waiting for longer than the ConnectionReserveTimeoutSeconds.
getWaitingForConnectionFailureTotal
in interface JDBCDataSourceRuntimeMBean
public int getWaitSecondsHighCount()
getWaitSecondsHighCount
in interface JDBCDataSourceRuntimeMBean
public int getConnectionsTotalCount()
getConnectionsTotalCount
in interface JDBCDataSourceRuntimeMBean
public int getCurrCapacity()
JDBCDataSourceRuntimeMBean
The current count of JDBC connections in the connection pool in the data source.
getCurrCapacity
in interface JDBCDataSourceRuntimeMBean
public int getCurrCapacityHighCount()
JDBCDataSourceRuntimeMBean
Highest number of database connections available or in use (current capacity) in this instance of the data source since the data source was deployed.
getCurrCapacityHighCount
in interface JDBCDataSourceRuntimeMBean
public int getNumAvailable()
JDBCDataSourceRuntimeMBean
The number of database connections that are currently idle and available to be used by applications in this instance of the data source.
getNumAvailable
in interface JDBCDataSourceRuntimeMBean
public int getHighestNumAvailable()
JDBCDataSourceRuntimeMBean
Highest number of database connections that were idle and available to be used by an application at any time in this instance of the data source since the data source was deployed.
getHighestNumAvailable
in interface JDBCDataSourceRuntimeMBean
public int getNumUnavailable()
JDBCDataSourceRuntimeMBean
The number of connections currently in use by applications or being tested in this instance of the data source.
getNumUnavailable
in interface JDBCDataSourceRuntimeMBean
public int getHighestNumUnavailable()
JDBCDataSourceRuntimeMBean
Highest number of database connections that were in use by applications or being tested by the system in this instance of the data source since the data source was deployed.
getHighestNumUnavailable
in interface JDBCDataSourceRuntimeMBean
public int getActiveConnectionsAverageCount()
JDBCDataSourceRuntimeMBean
Average number of active connections in this instance of the data source.
Active connections are connections in use by an application. This value is only valid if the resource is configured to allow shrinking.
getActiveConnectionsAverageCount
in interface JDBCDataSourceRuntimeMBean
public long getReserveRequestCount()
JDBCDataSourceRuntimeMBean
The cumulative, running count of requests for a connection from this data source.
getReserveRequestCount
in interface JDBCDataSourceRuntimeMBean
public long getFailedReserveRequestCount()
JDBCDataSourceRuntimeMBean
The cumulative, running count of requests for a connection from this data source that could not be fulfilled.
getFailedReserveRequestCount
in interface JDBCDataSourceRuntimeMBean
public long getRepurposeCount()
JDBCDataSourceRuntimeMBean
The number of times connections have been repurposed since the datasource was deployed.
getRepurposeCount
in interface JDBCDataSourceRuntimeMBean
public long getFailedRepurposeCount()
JDBCDataSourceRuntimeMBean
The number of repurpose errors that have occurred since the datasource was deployed.
getFailedRepurposeCount
in interface JDBCDataSourceRuntimeMBean
public long getResolvedAsCommittedTotalCount()
JDBCDataSourceRuntimeMBean
The cumulative total number of commit outcomes successfully resolved as committed in this data source since the data source was deployed. This does not refer to the number of outcome query retries used to resolve the outcomes.
getResolvedAsCommittedTotalCount
in interface JDBCDataSourceRuntimeMBean
public long getResolvedAsNotCommittedTotalCount()
JDBCDataSourceRuntimeMBean
The cumulative total number of commit outcomes successfully resolved as not committed in this data source since the data source was deployed. This does not refer to the number of outcome query retries used to resolve the outcomes.
getResolvedAsNotCommittedTotalCount
in interface JDBCDataSourceRuntimeMBean
public long getUnresolvedTotalCount()
JDBCDataSourceRuntimeMBean
The cumulative total number of commit outcomes unsuccessfully resolved in this data source since the data source was deployed. This does not refer to the number of outcome query retries used to resolve the outcomes.
getUnresolvedTotalCount
in interface JDBCDataSourceRuntimeMBean
public long getCommitOutcomeRetryTotalCount()
JDBCDataSourceRuntimeMBean
The cumulative total number of commit outcome query retries conducted before resolving the outcome or exceeding the retry seconds in this data source since the data source was deployed.
getCommitOutcomeRetryTotalCount
in interface JDBCDataSourceRuntimeMBean
public void shrink() throws ResourceException
JDBCDataSourceRuntimeMBean
Shrinks the database connection pool in the data source to either the current number of reserved connections or the initial size of the connection pool, which ever is greater.
This is a privileged operation that can only be invoked by an authorized user.
shrink
in interface JDBCDataSourceRuntimeMBean
ResourceException
public void reset() throws ResourceException
JDBCDataSourceRuntimeMBean
Resets the connection pool in the data source by shutting down and recreating all available database connections in the pool.
Use when a data source is in the health state of Unhealthy
and needs
to be reinitialized.
This is a privileged operation that can only be invoked by an authorized user.
reset
in interface JDBCDataSourceRuntimeMBean
ResourceException
public void suspend() throws ResourceException
JDBCDataSourceRuntimeMBean
Synchronously, gracefully suspends a data source that has the health
state of Running
and disables existing connections.
This operation immediately marks the data source as suspended
and no further connections are created. Idle (not reserved) connections
are marked as disabled. After a timeout period for
the suspend operation, all remaining connections in the pool
are marked as suspended and the following exception is thrown for
any operations on the connection, indicating that the data source
is suspended:
java.sql.SQLRecoverableException: Connection has been administratively disabled. Try later.
If graceful suspend is done as part of a graceful shutdown operation,
connections are immediately closed when no longer reserved or at the
end of the timeout period. If not done as part of a shutdown operation,
these connections remain in the pool and are not closed because the pool
may be resumed.
By default, the timeout period is 60 seconds. You can change the value of this timeout period by configuring or dynamically setting Inactive Connection Timeout Seconds to a non-zero value.
Setting IgnoreInUseConnectionsEnabled to false causes the operation to fail if in-use connections exist.
If successful, the health state is set to Suspended
.
This is a privileged operation that can only be invoked by an authorized user.
suspend
in interface JDBCDataSourceRuntimeMBean
ResourceException
public void forceSuspend() throws ResourceException
JDBCDataSourceRuntimeMBean
Forcefully suspends a data source that has the health state of
Running
, including disconnecting all current connection
users. All current connections are closed and recreated.
If successful, the health state is set to Suspended
.
This is a privileged operation that can only be invoked by an authorized user.
forceSuspend
in interface JDBCDataSourceRuntimeMBean
ResourceException
public void resume() throws ResourceException
JDBCDataSourceRuntimeMBean
Restores all access to and operations on a data source that has a health state of
Suspended
.
If successful, the health state is set to Running
.
This is a privileged operation that can only be invoked by an authorized user.
resume
in interface JDBCDataSourceRuntimeMBean
ResourceException
public void shutdown() throws ResourceException
JDBCDataSourceRuntimeMBean
Gracefully, synchronously shuts down a data source that has a health
state of Running
.
A graceful (non-forced) datasource shutdown operation involves first
gracefully suspending the data source and then releasing the associated
resources including the connections. See the description above for
details of gracefully suspending the datasource. After the datasource
is gracefully suspended, all remaining in-use connections are closed
and the datasource is marked as shut down.
If successful, the health state is set to Shutdown
.
This is a privileged operation that can only be invoked by an authorized user.
shutdown
in interface JDBCDataSourceRuntimeMBean
ResourceException
public void forceShutdown() throws ResourceException
JDBCDataSourceRuntimeMBean
Forcefully shuts down a data source that has a health state of Running
,
including forcing the disconnection of all current connection users.
If successful, the health state is set to Shutdown
.
This is a privileged operation that can only be invoked by an authorized user.
forceShutdown
in interface JDBCDataSourceRuntimeMBean
ResourceException
public JDBCDataSourceTaskRuntimeMBean suspend(int operationSecs) throws ResourceException
JDBCDataSourceRuntimeMBean
Asynchronously, gracefully suspends a data source that has the health
state of Running
and disables existing connections.
This operation immediately marks the data source as suspended
and no further connections are created. Idle (not reserved) connections
are marked as disabled. After a timeout period for
the suspend operation, all remaining connections in the pool
are marked as suspended and the following exception is thrown for
any operations on the connection, indicating that the data source
is suspended:
java.sql.SQLRecoverableException: Connection has been administratively disabled. Try later.
These connections remain in the pool and are not closed because the pool
may be resumed.
Setting IgnoreInUseConnectionsEnabled to false causes the operation to fail if in-use connections exist.
If successful, the health state is set to Suspended
.
This is a privileged operation that can only be invoked by an authorized user.
suspend
in interface JDBCDataSourceRuntimeMBean
operationSecs
- The number of seconds to allow the operation to
run before stopping processing. If set to 0, the default is used.
The default is to use Inactive Connection Timeout Seconds if set or
60 seconds. If you want a minimal timeout, set the value to 1.
If you want no timeout, set it to a large value (not recommended).ResourceException
public JDBCDataSourceTaskRuntimeMBean shutdown(int operationSecs) throws ResourceException
JDBCDataSourceRuntimeMBean
Gracefully, asynchronously shuts down a data source that has a health
state of Running
.
A graceful (non-forced) datasource shutdown operation involves first
gracefully suspending the data source and then releasing the associated
resources including the connections. See the description above for
details of gracefully suspending the datasource. After the datasource
is gracefully suspended, all remaining in-use connections are closed
and the datasource is marked as shut down.
Setting IgnoreInUseConnectionsEnabled to false causes the operation to fail if in-use connections exist.
If successful, the health state is set to Shutdown
.
This is a privileged operation that can only be invoked by an authorized user.
shutdown
in interface JDBCDataSourceRuntimeMBean
operationSecs
- The number of seconds to allow the operation to
run before stopping processing. If set to 0, the default is used.
The default is to use Inactive Connection Timeout Seconds if set or
60 seconds. If you want a minimal timeout, set the value to 1.
If you want no timeout, set it to a large value (not recommended).ResourceException
private JDBCDataSourceTaskRuntimeMBeanImpl setTask(boolean shutdown)
private void doOperation(boolean shutdown, int operationSecs, JDBCDataSourceTaskRuntimeMBeanImpl task) throws ResourceException
ResourceException
public java.util.Properties getProperties() throws ResourceException
This is a privileged method, and can only be invoked on a client that has specified an authorized Principal.
getProperties
in interface JDBCDataSourceRuntimeMBean
java.lang.Exception
- if there is an errorResourceException
public boolean poolExists(java.lang.String poolName) throws java.lang.Exception
This is a privileged method, and can only be invoked on a client that has specified an authorized Principal.
poolExists
in interface JDBCDataSourceRuntimeMBean
name
- Name of the pool being looked forjava.lang.Exception
- if there is an errorpublic void clearStatementCache() throws java.lang.Exception
clearStatementCache
in interface JDBCDataSourceRuntimeMBean
java.lang.Exception
- if there is an errorpublic void dumpPool() throws java.lang.Exception
JDBCDataSourceRuntimeMBean
Prints out information about all the connections in the connection pool in the data source.
dumpPool
in interface JDBCDataSourceRuntimeMBean
java.lang.Exception
public void dumpPoolProfile() throws java.lang.Exception
JDBCDataSourceRuntimeMBean
Prints out profile information about the data source.
dumpPoolProfile
in interface JDBCDataSourceRuntimeMBean
java.lang.Exception
public void setJDBCDriverRuntime(JDBCDriverRuntimeMBean mbean)
JDBCDataSourceRuntimeMBean
Sets the JDBCDriverRuntimeMBean associated with this data source.
setJDBCDriverRuntime
in interface JDBCDataSourceRuntimeMBean
public JDBCDriverRuntimeMBean getJDBCDriverRuntime()
JDBCDataSourceRuntimeMBean
Gets the JDBCDriverRuntimeMBean associated with this data source.
getJDBCDriverRuntime
in interface JDBCDataSourceRuntimeMBean
public JDBCDataSourceTaskRuntimeMBean getLastTask()
JDBCDataSourceRuntimeMBean
Get the last datasource Task
getLastTask
in interface JDBCDataSourceRuntimeMBean
public JDBCDataSourceTaskRuntimeMBean[] getTasks()
Get preexisting DataSource Tasks
getTasks
in interface JDBCDataSourceRuntimeMBean
public void start() throws java.lang.Exception
JDBCDataSourceRuntimeMBean
Starts a data source that has a health state of Shutdown
.
If successful, the health state is set to Running
.
This is a privileged operation that can only be invoked by an authorized user.
start
in interface JDBCDataSourceRuntimeMBean
java.lang.Exception
- if there is an errorpublic boolean isOperationAllowed(java.lang.String operation) throws java.lang.IllegalArgumentException
JDBCDataSourceRuntimeMBean
Indicates whether the specified operation is valid based on the state of the underlying DataSource.
isOperationAllowed
in interface JDBCDataSourceRuntimeMBean
operation
- The name of the operation to be performed. Valid values include: Start, Shutdown, Suspend, Resume, Reset, Shrink, Clearjava.lang.IllegalArgumentException
- Thrown when operation parameter is not recognized as a supported operation.private void clearCachedValues()
protected void lookupMetaData() throws ResourceException, java.sql.SQLException
ResourceException
java.sql.SQLException
private void getMetaData() throws ResourceException, java.sql.SQLException
ResourceException
java.sql.SQLException
public java.lang.String getDatabaseProductName() throws java.rmi.RemoteException
JDBCDataSourceRuntimeMBean
The product name of the database that this data source is connected to.
getDatabaseProductName
in interface JDBCDataSourceRuntimeMBean
java.rmi.RemoteException
- Thrown when the operation is unable to obtain the attribute from
the JDBC meta data.public java.lang.String getDatabaseProductVersion() throws java.rmi.RemoteException
JDBCDataSourceRuntimeMBean
The product version of the database that this data source is connected to.
getDatabaseProductVersion
in interface JDBCDataSourceRuntimeMBean
java.rmi.RemoteException
- Thrown when the operation is unable to obtain the attribute from
the JDBC meta data.public java.lang.String getDriverName() throws java.rmi.RemoteException
JDBCDataSourceRuntimeMBean
The product name of the JDBC driver that this data source is configured to use.
getDriverName
in interface JDBCDataSourceRuntimeMBean
java.rmi.RemoteException
- Thrown when the operation is unable to obtain the attribute from
the JDBC meta data.public java.lang.String getDriverVersion() throws java.rmi.RemoteException
JDBCDataSourceRuntimeMBean
The version of the JDBC driver that this data source is configured to use.
getDriverVersion
in interface JDBCDataSourceRuntimeMBean
java.rmi.RemoteException
- Thrown when the operation is unable to obtain the attribute from
the JDBC meta data.public JDBCReplayStatisticsRuntimeMBean getJDBCReplayStatisticsRuntimeMBean() throws java.lang.Exception
JDBCDataSourceRuntimeMBean
Get the statistics for replay only if the datasource is using an Oracle replay driver for 12.1.0.2 and later. Otherwise, null is returned. The statistics are a snapshort. To update the snapshot, call refreshStatistics() on the mbean.
getJDBCReplayStatisticsRuntimeMBean
in interface JDBCDataSourceRuntimeMBean
java.lang.Exception
- Thown when an error occurs getting the statistics.public void clearOldTaskRuntimes()
private void throwGroupOperationUnsupported()
public void resetStatistics()
JDBCDataSourceRuntimeMBean
resetStatistics
in interface JDBCDataSourceRuntimeMBean