001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.commons.dbcp2; 018 019/** 020 * Defines the methods that will be made available via JMX. 021 * 022 * @version $Id: BasicDataSourceMXBean.java 1660787 2015-02-19 04:05:33Z psteitz $ 023 * @since 2.0 024 */ 025public interface BasicDataSourceMXBean { 026 027 /** 028 * See {@link BasicDataSource#getAbandonedUsageTracking()} 029 * @return {@link BasicDataSource#getAbandonedUsageTracking()} 030 */ 031 boolean getAbandonedUsageTracking(); 032 033 /** 034 * See {@link BasicDataSource#getDefaultAutoCommit()} 035 * @return {@link BasicDataSource#getDefaultAutoCommit()} 036 */ 037 Boolean getDefaultAutoCommit(); 038 039 /** 040 * See {@link BasicDataSource#getDefaultReadOnly()} 041 * @return {@link BasicDataSource#getDefaultReadOnly()} 042 */ 043 Boolean getDefaultReadOnly(); 044 045 /** 046 * See {@link BasicDataSource#getDefaultTransactionIsolation()} 047 * @return {@link BasicDataSource#getDefaultTransactionIsolation()} 048 */ 049 int getDefaultTransactionIsolation(); 050 051 /** 052 * See {@link BasicDataSource#getDefaultCatalog()} 053 * @return {@link BasicDataSource#getDefaultCatalog()} 054 */ 055 String getDefaultCatalog(); 056 057 /** 058 * See {@link BasicDataSource#getCacheState()} 059 * @return {@link BasicDataSource#getCacheState()} 060 */ 061 boolean getCacheState(); 062 063 /** 064 * See {@link BasicDataSource#getDriverClassName()} 065 * @return {@link BasicDataSource#getDriverClassName()} 066 */ 067 String getDriverClassName(); 068 069 /** 070 * See {@link BasicDataSource#getLifo()} 071 * @return {@link BasicDataSource#getLifo()} 072 */ 073 boolean getLifo(); 074 075 /** 076 * See {@link BasicDataSource#getMaxTotal()} 077 * @return {@link BasicDataSource#getMaxTotal()} 078 */ 079 int getMaxTotal(); 080 081 /** 082 * See {@link BasicDataSource#getMaxIdle()} 083 * @return {@link BasicDataSource#getMaxIdle()} 084 */ 085 int getMaxIdle(); 086 087 /** 088 * See {@link BasicDataSource#getMinIdle()} 089 * @return {@link BasicDataSource#getMinIdle()} 090 */ 091 int getMinIdle(); 092 093 /** 094 * See {@link BasicDataSource#getInitialSize()} 095 * @return {@link BasicDataSource#getInitialSize()} 096 */ 097 int getInitialSize(); 098 099 /** 100 * See {@link BasicDataSource#getMaxWaitMillis()} 101 * @return {@link BasicDataSource#getMaxWaitMillis()} 102 */ 103 long getMaxWaitMillis(); 104 105 /** 106 * See {@link BasicDataSource#isPoolPreparedStatements()} 107 * @return {@link BasicDataSource#isPoolPreparedStatements()} 108 */ 109 boolean isPoolPreparedStatements(); 110 111 /** 112 * See {@link BasicDataSource#getMaxOpenPreparedStatements()} 113 * @return {@link BasicDataSource#getMaxOpenPreparedStatements()} 114 */ 115 int getMaxOpenPreparedStatements(); 116 117 /** 118 * See {@link BasicDataSource#getTestOnCreate()} 119 * @return {@link BasicDataSource#getTestOnCreate()} 120 */ 121 boolean getTestOnCreate(); 122 123 /** 124 * See {@link BasicDataSource#getTestOnBorrow()} 125 * @return {@link BasicDataSource#getTestOnBorrow()} 126 */ 127 boolean getTestOnBorrow(); 128 129 /** 130 * See {@link BasicDataSource#getTimeBetweenEvictionRunsMillis()} 131 * @return {@link BasicDataSource#getTimeBetweenEvictionRunsMillis()} 132 */ 133 long getTimeBetweenEvictionRunsMillis(); 134 135 /** 136 * See {@link BasicDataSource#getNumTestsPerEvictionRun()} 137 * @return {@link BasicDataSource#getNumTestsPerEvictionRun()} 138 */ 139 int getNumTestsPerEvictionRun(); 140 141 /** 142 * See {@link BasicDataSource#getMinEvictableIdleTimeMillis()} 143 * @return {@link BasicDataSource#getMinEvictableIdleTimeMillis()} 144 */ 145 long getMinEvictableIdleTimeMillis(); 146 147 /** 148 * See {@link BasicDataSource#getSoftMinEvictableIdleTimeMillis()} 149 * @return {@link BasicDataSource#getSoftMinEvictableIdleTimeMillis()} 150 */ 151 long getSoftMinEvictableIdleTimeMillis(); 152 153 /** 154 * See {@link BasicDataSource#getTestWhileIdle()} 155 * @return {@link BasicDataSource#getTestWhileIdle()} 156 */ 157 boolean getTestWhileIdle(); 158 159 /** 160 * See {@link BasicDataSource#getNumActive()} 161 * @return {@link BasicDataSource#getNumActive()} 162 */ 163 int getNumActive(); 164 165 /** 166 * See {@link BasicDataSource#getNumIdle()} 167 * @return {@link BasicDataSource#getNumIdle()} 168 */ 169 int getNumIdle(); 170 171 /** 172 * See {@link BasicDataSource#getPassword()} 173 * @return {@link BasicDataSource#getPassword()} 174 */ 175 String getPassword(); 176 177 /** 178 * See {@link BasicDataSource#getUrl()} 179 * @return {@link BasicDataSource#getUrl()} 180 */ 181 String getUrl(); 182 183 /** 184 * See {@link BasicDataSource#getUsername()} 185 * @return {@link BasicDataSource#getUsername()} 186 */ 187 String getUsername(); 188 189 /** 190 * See {@link BasicDataSource#getValidationQuery()} 191 * @return {@link BasicDataSource#getValidationQuery()} 192 */ 193 String getValidationQuery(); 194 195 /** 196 * See {@link BasicDataSource#getValidationQueryTimeout()} 197 * @return {@link BasicDataSource#getValidationQueryTimeout()} 198 */ 199 int getValidationQueryTimeout(); 200 201 /** 202 * See {@link BasicDataSource#getConnectionInitSqlsAsArray()} 203 * @return {@link BasicDataSource#getConnectionInitSqlsAsArray()} 204 */ 205 String[] getConnectionInitSqlsAsArray(); 206 207 /** 208 * See {@link BasicDataSource#isAccessToUnderlyingConnectionAllowed()} 209 * @return {@link BasicDataSource#isAccessToUnderlyingConnectionAllowed()} 210 */ 211 boolean isAccessToUnderlyingConnectionAllowed(); 212 213 /** 214 * See {@link BasicDataSource#getMaxConnLifetimeMillis()} 215 * @return {@link BasicDataSource#getMaxConnLifetimeMillis()} 216 */ 217 long getMaxConnLifetimeMillis(); 218 219 /** 220 * See {@link BasicDataSource#getLogExpiredConnections()} 221 * @return {@link BasicDataSource#getLogExpiredConnections()} 222 * @since 2.1 223 */ 224 boolean getLogExpiredConnections(); 225 226 /** 227 * See {@link BasicDataSource#getRemoveAbandonedOnBorrow()} 228 * @return {@link BasicDataSource#getRemoveAbandonedOnBorrow()} 229 */ 230 boolean getRemoveAbandonedOnBorrow(); 231 232 /** 233 * See {@link BasicDataSource#getRemoveAbandonedOnMaintenance()} 234 * @return {@link BasicDataSource#getRemoveAbandonedOnMaintenance()} 235 */ 236 boolean getRemoveAbandonedOnMaintenance(); 237 238 /** 239 * See {@link BasicDataSource#getRemoveAbandonedTimeout()} 240 * @return {@link BasicDataSource#getRemoveAbandonedTimeout()} 241 */ 242 int getRemoveAbandonedTimeout(); 243 244 /** 245 * See {@link BasicDataSource#getLogAbandoned()} 246 * @return {@link BasicDataSource#getLogAbandoned()} 247 */ 248 boolean getLogAbandoned(); 249 250 /** 251 * See {@link BasicDataSource#isClosed()} 252 * @return {@link BasicDataSource#isClosed()} 253 */ 254 boolean isClosed(); 255 256 /** 257 * See {@link BasicDataSource#getFastFailValidation()} 258 * @return {@link BasicDataSource#getFastFailValidation()} 259 * @since 2.1 260 */ 261 boolean getFastFailValidation(); 262 263 /** 264 * See {@link BasicDataSource#getDisconnectionSqlCodesAsArray()} 265 * @return {@link BasicDataSource#getDisconnectionSqlCodesAsArray()} 266 * @since 2.1 267 */ 268 String[] getDisconnectionSqlCodesAsArray(); 269}