/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.dbcp2;

import java.sql.SQLException;

Defines the methods that will be made available via JMX.
Since:2.0
/** * Defines the methods that will be made available via JMX. * * @since 2.0 */
public interface BasicDataSourceMXBean {
Returns:BasicDataSource.getAbandonedUsageTracking()
/** * See {@link BasicDataSource#getAbandonedUsageTracking()} * * @return {@link BasicDataSource#getAbandonedUsageTracking()} */
boolean getAbandonedUsageTracking();
Returns:BasicDataSource.getDefaultAutoCommit()
/** * See {@link BasicDataSource#getDefaultAutoCommit()} * * @return {@link BasicDataSource#getDefaultAutoCommit()} */
Boolean getDefaultAutoCommit();
Returns:BasicDataSource.getDefaultReadOnly()
/** * See {@link BasicDataSource#getDefaultReadOnly()} * * @return {@link BasicDataSource#getDefaultReadOnly()} */
Boolean getDefaultReadOnly();
Returns:BasicDataSource.getDefaultTransactionIsolation()
/** * See {@link BasicDataSource#getDefaultTransactionIsolation()} * * @return {@link BasicDataSource#getDefaultTransactionIsolation()} */
int getDefaultTransactionIsolation();
Returns:BasicDataSource.getDefaultCatalog()
/** * See {@link BasicDataSource#getDefaultCatalog()} * * @return {@link BasicDataSource#getDefaultCatalog()} */
String getDefaultCatalog();
Returns:BasicDataSource.getDefaultSchema()
Since:2.5.0
/** * See {@link BasicDataSource#getDefaultSchema()} * * @return {@link BasicDataSource#getDefaultSchema()} * @since 2.5.0 */
default String getDefaultSchema() { return null; }
Returns:BasicDataSource.getCacheState()
/** * See {@link BasicDataSource#getCacheState()} * * @return {@link BasicDataSource#getCacheState()} */
boolean getCacheState();
Returns:BasicDataSource.getDriverClassName()
/** * See {@link BasicDataSource#getDriverClassName()} * * @return {@link BasicDataSource#getDriverClassName()} */
String getDriverClassName();
Returns:BasicDataSource.getLifo()
/** * See {@link BasicDataSource#getLifo()} * * @return {@link BasicDataSource#getLifo()} */
boolean getLifo();
Returns:BasicDataSource.getMaxTotal()
/** * See {@link BasicDataSource#getMaxTotal()} * * @return {@link BasicDataSource#getMaxTotal()} */
int getMaxTotal();
Returns:BasicDataSource.getMaxIdle()
/** * See {@link BasicDataSource#getMaxIdle()} * * @return {@link BasicDataSource#getMaxIdle()} */
int getMaxIdle();
Returns:BasicDataSource.getMinIdle()
/** * See {@link BasicDataSource#getMinIdle()} * * @return {@link BasicDataSource#getMinIdle()} */
int getMinIdle();
Returns:BasicDataSource.getInitialSize()
/** * See {@link BasicDataSource#getInitialSize()} * * @return {@link BasicDataSource#getInitialSize()} */
int getInitialSize();
Returns:BasicDataSource.getMaxWaitMillis()
/** * See {@link BasicDataSource#getMaxWaitMillis()} * * @return {@link BasicDataSource#getMaxWaitMillis()} */
long getMaxWaitMillis();
Returns:BasicDataSource.isPoolPreparedStatements()
/** * See {@link BasicDataSource#isPoolPreparedStatements()} * * @return {@link BasicDataSource#isPoolPreparedStatements()} */
boolean isPoolPreparedStatements();
Returns:BasicDataSource.isClearStatementPoolOnReturn()
Since:2.8.0
/** * See {@link BasicDataSource#isClearStatementPoolOnReturn()} * * @return {@link BasicDataSource#isClearStatementPoolOnReturn()} * @since 2.8.0 */
default boolean isClearStatementPoolOnReturn() { return false; }
Returns:BasicDataSource.getMaxOpenPreparedStatements()
/** * See {@link BasicDataSource#getMaxOpenPreparedStatements()} * * @return {@link BasicDataSource#getMaxOpenPreparedStatements()} */
int getMaxOpenPreparedStatements();
Returns:BasicDataSource.getTestOnCreate()
/** * See {@link BasicDataSource#getTestOnCreate()} * * @return {@link BasicDataSource#getTestOnCreate()} */
boolean getTestOnCreate();
Returns:BasicDataSource.getTestOnBorrow()
/** * See {@link BasicDataSource#getTestOnBorrow()} * * @return {@link BasicDataSource#getTestOnBorrow()} */
boolean getTestOnBorrow();
Returns:BasicDataSource.getTimeBetweenEvictionRunsMillis()
/** * See {@link BasicDataSource#getTimeBetweenEvictionRunsMillis()} * * @return {@link BasicDataSource#getTimeBetweenEvictionRunsMillis()} */
long getTimeBetweenEvictionRunsMillis();
Returns:BasicDataSource.getNumTestsPerEvictionRun()
/** * See {@link BasicDataSource#getNumTestsPerEvictionRun()} * * @return {@link BasicDataSource#getNumTestsPerEvictionRun()} */
int getNumTestsPerEvictionRun();
Returns:BasicDataSource.getMinEvictableIdleTimeMillis()
/** * See {@link BasicDataSource#getMinEvictableIdleTimeMillis()} * * @return {@link BasicDataSource#getMinEvictableIdleTimeMillis()} */
long getMinEvictableIdleTimeMillis();
Returns:BasicDataSource.getSoftMinEvictableIdleTimeMillis()
/** * See {@link BasicDataSource#getSoftMinEvictableIdleTimeMillis()} * * @return {@link BasicDataSource#getSoftMinEvictableIdleTimeMillis()} */
long getSoftMinEvictableIdleTimeMillis();
Returns:BasicDataSource.getTestWhileIdle()
/** * See {@link BasicDataSource#getTestWhileIdle()} * * @return {@link BasicDataSource#getTestWhileIdle()} */
boolean getTestWhileIdle();
Returns:BasicDataSource.getNumActive()
/** * See {@link BasicDataSource#getNumActive()} * * @return {@link BasicDataSource#getNumActive()} */
int getNumActive();
Returns:BasicDataSource.getNumIdle()
/** * See {@link BasicDataSource#getNumIdle()} * * @return {@link BasicDataSource#getNumIdle()} */
int getNumIdle();
Returns:BasicDataSource.getPassword()
/** * See {@link BasicDataSource#getPassword()} * * @return {@link BasicDataSource#getPassword()} */
String getPassword();
Returns:BasicDataSource.getUrl()
/** * See {@link BasicDataSource#getUrl()} * * @return {@link BasicDataSource#getUrl()} */
String getUrl();
Returns:BasicDataSource.getUsername()
/** * See {@link BasicDataSource#getUsername()} * * @return {@link BasicDataSource#getUsername()} */
String getUsername();
Returns:BasicDataSource.getValidationQuery()
/** * See {@link BasicDataSource#getValidationQuery()} * * @return {@link BasicDataSource#getValidationQuery()} */
String getValidationQuery();
Returns:BasicDataSource.getValidationQueryTimeout()
/** * See {@link BasicDataSource#getValidationQueryTimeout()} * * @return {@link BasicDataSource#getValidationQueryTimeout()} */
int getValidationQueryTimeout();
Returns:BasicDataSource.getConnectionInitSqlsAsArray()
/** * See {@link BasicDataSource#getConnectionInitSqlsAsArray()} * * @return {@link BasicDataSource#getConnectionInitSqlsAsArray()} */
String[] getConnectionInitSqlsAsArray();
Returns:BasicDataSource.isAccessToUnderlyingConnectionAllowed()
/** * See {@link BasicDataSource#isAccessToUnderlyingConnectionAllowed()} * * @return {@link BasicDataSource#isAccessToUnderlyingConnectionAllowed()} */
boolean isAccessToUnderlyingConnectionAllowed();
Returns:BasicDataSource.getMaxConnLifetimeMillis()
/** * See {@link BasicDataSource#getMaxConnLifetimeMillis()} * * @return {@link BasicDataSource#getMaxConnLifetimeMillis()} */
long getMaxConnLifetimeMillis();
Returns:BasicDataSource.getLogExpiredConnections()
Since:2.1
/** * See {@link BasicDataSource#getLogExpiredConnections()} * * @return {@link BasicDataSource#getLogExpiredConnections()} * @since 2.1 */
boolean getLogExpiredConnections();
Returns:BasicDataSource.getRemoveAbandonedOnBorrow()
/** * See {@link BasicDataSource#getRemoveAbandonedOnBorrow()} * * @return {@link BasicDataSource#getRemoveAbandonedOnBorrow()} */
boolean getRemoveAbandonedOnBorrow();
Returns:BasicDataSource.getRemoveAbandonedOnMaintenance()
/** * See {@link BasicDataSource#getRemoveAbandonedOnMaintenance()} * * @return {@link BasicDataSource#getRemoveAbandonedOnMaintenance()} */
boolean getRemoveAbandonedOnMaintenance();
Returns:BasicDataSource.getRemoveAbandonedTimeout()
/** * See {@link BasicDataSource#getRemoveAbandonedTimeout()} * * @return {@link BasicDataSource#getRemoveAbandonedTimeout()} */
int getRemoveAbandonedTimeout();
Returns:BasicDataSource.getLogAbandoned()
/** * See {@link BasicDataSource#getLogAbandoned()} * * @return {@link BasicDataSource#getLogAbandoned()} */
boolean getLogAbandoned();
Returns:BasicDataSource.isClosed()
/** * See {@link BasicDataSource#isClosed()} * * @return {@link BasicDataSource#isClosed()} */
boolean isClosed();
Returns:BasicDataSource.getFastFailValidation()
Since:2.1
/** * See {@link BasicDataSource#getFastFailValidation()} * * @return {@link BasicDataSource#getFastFailValidation()} * @since 2.1 */
boolean getFastFailValidation();
Returns:BasicDataSource.getDisconnectionSqlCodesAsArray()
Since:2.1
/** * See {@link BasicDataSource#getDisconnectionSqlCodesAsArray()} * * @return {@link BasicDataSource#getDisconnectionSqlCodesAsArray()} * @since 2.1 */
String[] getDisconnectionSqlCodesAsArray();
Throws:
  • SQLException – if an error occurs initializing the datasource
Since:2.8.0
/** * See {@link BasicDataSource#start()} * * @throws SQLException if an error occurs initializing the datasource * * @since 2.8.0 */
default void start() throws SQLException { // do nothing }
Throws:
  • SQLException – if an error occurs initializing the datasource
Since:2.8.0
/** * See {@link BasicDataSource#restart()} * * @throws SQLException if an error occurs initializing the datasource * * @since 2.8.0 */
default void restart() throws SQLException { // do nothing by default? } }