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.pool2.impl; 018 019import java.util.Set; 020 021/** 022 * Defines the methods that will be made available via JMX. 023 * 024 * NOTE: This interface exists only to define those attributes and methods that 025 * will be made available via JMX. It must not be implemented by clients 026 * as it is subject to change between major, minor and patch version 027 * releases of commons pool. Clients that implement this interface may 028 * not, therefore, be able to upgrade to a new minor or patch release 029 * without requiring code changes. 030 * 031 * @version $Revision: $ 032 * 033 * @since 2.0 034 */ 035public interface GenericObjectPoolMXBean { 036 // Getters for basic configuration settings 037 /** 038 * See {@link GenericObjectPool#getBlockWhenExhausted()} 039 * @return See {@link GenericObjectPool#getBlockWhenExhausted()} 040 */ 041 boolean getBlockWhenExhausted(); 042 /** 043 * See {@link GenericObjectPool#getLifo()} 044 * @return See {@link GenericObjectPool#getLifo()} 045 */ 046 boolean getFairness(); 047 /** 048 * See {@link GenericObjectPool#getFairness()} 049 * @return See {@link GenericObjectPool#getFairness()} 050 */ 051 boolean getLifo(); 052 /** 053 * See {@link GenericObjectPool#getMaxIdle()} 054 * @return See {@link GenericObjectPool#getMaxIdle()} 055 */ 056 int getMaxIdle(); 057 /** 058 * See {@link GenericObjectPool#getMaxTotal()} 059 * @return See {@link GenericObjectPool#getMaxTotal()} 060 */ 061 int getMaxTotal(); 062 /** 063 * See {@link GenericObjectPool#getMaxWaitMillis()} 064 * @return See {@link GenericObjectPool#getMaxWaitMillis()} 065 */ 066 long getMaxWaitMillis(); 067 /** 068 * See {@link GenericObjectPool#getMinEvictableIdleTimeMillis()} 069 * @return See {@link GenericObjectPool#getMinEvictableIdleTimeMillis()} 070 */ 071 long getMinEvictableIdleTimeMillis(); 072 /** 073 * See {@link GenericObjectPool#getMinIdle()} 074 * @return See {@link GenericObjectPool#getMinIdle()} 075 */ 076 int getMinIdle(); 077 /** 078 * See {@link GenericObjectPool#getNumActive()} 079 * @return See {@link GenericObjectPool#getNumActive()} 080 */ 081 int getNumActive(); 082 /** 083 * See {@link GenericObjectPool#getNumIdle()} 084 * @return See {@link GenericObjectPool#getNumIdle()} 085 */ 086 int getNumIdle(); 087 /** 088 * See {@link GenericObjectPool#getNumTestsPerEvictionRun()} 089 * @return See {@link GenericObjectPool#getNumTestsPerEvictionRun()} 090 */ 091 int getNumTestsPerEvictionRun(); 092 /** 093 * See {@link GenericObjectPool#getTestOnCreate()} 094 * @return See {@link GenericObjectPool#getTestOnCreate()} 095 * @since 2.2 096 */ 097 boolean getTestOnCreate(); 098 /** 099 * See {@link GenericObjectPool#getTestOnBorrow()} 100 * @return See {@link GenericObjectPool#getTestOnBorrow()} 101 */ 102 boolean getTestOnBorrow(); 103 /** 104 * See {@link GenericObjectPool#getTestOnReturn()} 105 * @return See {@link GenericObjectPool#getTestOnReturn()} 106 */ 107 boolean getTestOnReturn(); 108 /** 109 * See {@link GenericObjectPool#getTestWhileIdle()} 110 * @return See {@link GenericObjectPool#getTestWhileIdle()} 111 */ 112 boolean getTestWhileIdle(); 113 /** 114 * See {@link GenericObjectPool#getTimeBetweenEvictionRunsMillis()} 115 * @return See {@link GenericObjectPool#getTimeBetweenEvictionRunsMillis()} 116 */ 117 long getTimeBetweenEvictionRunsMillis(); 118 /** 119 * See {@link GenericObjectPool#isClosed()} 120 * @return See {@link GenericObjectPool#isClosed()} 121 */ 122 boolean isClosed(); 123 // Getters for monitoring attributes 124 /** 125 * See {@link GenericObjectPool#getBorrowedCount()} 126 * @return See {@link GenericObjectPool#getBorrowedCount()} 127 */ 128 long getBorrowedCount(); 129 /** 130 * See {@link GenericObjectPool#getReturnedCount()} 131 * @return See {@link GenericObjectPool#getReturnedCount()} 132 */ 133 long getReturnedCount(); 134 /** 135 * See {@link GenericObjectPool#getCreatedCount()} 136 * @return See {@link GenericObjectPool#getCreatedCount()} 137 */ 138 long getCreatedCount(); 139 /** 140 * See {@link GenericObjectPool#getDestroyedCount()} 141 * @return See {@link GenericObjectPool#getDestroyedCount()} 142 */ 143 long getDestroyedCount(); 144 /** 145 * See {@link GenericObjectPool#getDestroyedByEvictorCount()} 146 * @return See {@link GenericObjectPool#getDestroyedByEvictorCount()} 147 */ 148 long getDestroyedByEvictorCount(); 149 /** 150 * See {@link GenericObjectPool#getDestroyedByBorrowValidationCount()} 151 * @return See {@link GenericObjectPool#getDestroyedByBorrowValidationCount()} 152 */ 153 long getDestroyedByBorrowValidationCount(); 154 /** 155 * See {@link GenericObjectPool#getMeanActiveTimeMillis()} 156 * @return See {@link GenericObjectPool#getMeanActiveTimeMillis()} 157 */ 158 long getMeanActiveTimeMillis(); 159 /** 160 * See {@link GenericObjectPool#getMeanIdleTimeMillis()} 161 * @return See {@link GenericObjectPool#getMeanIdleTimeMillis()} 162 */ 163 long getMeanIdleTimeMillis(); 164 /** 165 * See {@link GenericObjectPool#getMeanBorrowWaitTimeMillis()} 166 * @return See {@link GenericObjectPool#getMeanBorrowWaitTimeMillis()} 167 */ 168 long getMeanBorrowWaitTimeMillis(); 169 /** 170 * See {@link GenericObjectPool#getMaxBorrowWaitTimeMillis()} 171 * @return See {@link GenericObjectPool#getMaxBorrowWaitTimeMillis()} 172 */ 173 long getMaxBorrowWaitTimeMillis(); 174 /** 175 * See {@link GenericObjectPool#getCreationStackTrace()} 176 * @return See {@link GenericObjectPool#getCreationStackTrace()} 177 */ 178 String getCreationStackTrace(); 179 /** 180 * See {@link GenericObjectPool#getNumWaiters()} 181 * @return See {@link GenericObjectPool#getNumWaiters()} 182 */ 183 int getNumWaiters(); 184 185 // Getters for abandoned object removal configuration 186 /** 187 * See {@link GenericObjectPool#isAbandonedConfig()} 188 * @return See {@link GenericObjectPool#isAbandonedConfig()} 189 */ 190 boolean isAbandonedConfig(); 191 /** 192 * See {@link GenericObjectPool#getLogAbandoned()} 193 * @return See {@link GenericObjectPool#getLogAbandoned()} 194 */ 195 boolean getLogAbandoned(); 196 /** 197 * See {@link GenericObjectPool#getRemoveAbandonedOnBorrow()} 198 * @return See {@link GenericObjectPool#getRemoveAbandonedOnBorrow()} 199 */ 200 boolean getRemoveAbandonedOnBorrow(); 201 /** 202 * See {@link GenericObjectPool#getRemoveAbandonedOnMaintenance()} 203 * @return See {@link GenericObjectPool#getRemoveAbandonedOnMaintenance()} 204 */ 205 boolean getRemoveAbandonedOnMaintenance(); 206 /** 207 * See {@link GenericObjectPool#getRemoveAbandonedTimeout()} 208 * @return See {@link GenericObjectPool#getRemoveAbandonedTimeout()} 209 */ 210 int getRemoveAbandonedTimeout(); 211 /** 212 * See {@link GenericObjectPool#getFactoryType()} 213 * @return See {@link GenericObjectPool#getFactoryType()} 214 */ 215 public String getFactoryType(); 216 /** 217 * See {@link GenericObjectPool#listAllObjects()} 218 * @return See {@link GenericObjectPool#listAllObjects()} 219 */ 220 Set<DefaultPooledObjectInfo> listAllObjects(); 221}