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 is subject to change between major version releases
025 * of commons pool.
026 *
027 * @version $Revision: $
028 *
029 * @since 2.0
030 */
031public interface GenericObjectPoolMXBean {
032    // Getters for basic configuration settings
033    /**
034     * See {@link GenericObjectPool#getBlockWhenExhausted()}
035     * @return See {@link GenericObjectPool#getBlockWhenExhausted()}
036     */
037    boolean getBlockWhenExhausted();
038    /**
039     * See {@link GenericObjectPool#getLifo()}
040     * @return See {@link GenericObjectPool#getLifo()}
041     */
042    boolean getLifo();
043    /**
044     * See {@link GenericObjectPool#getMaxIdle()}
045     * @return See {@link GenericObjectPool#getMaxIdle()}
046     */
047    int getMaxIdle();
048    /**
049     * See {@link GenericObjectPool#getMaxTotal()}
050     * @return See {@link GenericObjectPool#getMaxTotal()}
051     */
052    int getMaxTotal();
053    /**
054     * See {@link GenericObjectPool#getMaxWaitMillis()}
055     * @return See {@link GenericObjectPool#getMaxWaitMillis()}
056     */
057    long getMaxWaitMillis();
058    /**
059     * See {@link GenericObjectPool#getMinEvictableIdleTimeMillis()}
060     * @return See {@link GenericObjectPool#getMinEvictableIdleTimeMillis()}
061     */
062    long getMinEvictableIdleTimeMillis();
063    /**
064     * See {@link GenericObjectPool#getMinIdle()}
065     * @return See {@link GenericObjectPool#getMinIdle()}
066     */
067    int getMinIdle();
068    /**
069     * See {@link GenericObjectPool#getNumActive()}
070     * @return See {@link GenericObjectPool#getNumActive()}
071     */
072    int getNumActive();
073    /**
074     * See {@link GenericObjectPool#getNumIdle()}
075     * @return See {@link GenericObjectPool#getNumIdle()}
076     */
077    int getNumIdle();
078    /**
079     * See {@link GenericObjectPool#getNumTestsPerEvictionRun()}
080     * @return See {@link GenericObjectPool#getNumTestsPerEvictionRun()}
081     */
082    int getNumTestsPerEvictionRun();
083    /**
084     * See {@link GenericObjectPool#getTestOnBorrow()}
085     * @return See {@link GenericObjectPool#getTestOnBorrow()}
086     */
087    boolean getTestOnBorrow();
088    /**
089     * See {@link GenericObjectPool#getTestOnReturn()}
090     * @return See {@link GenericObjectPool#getTestOnReturn()}
091     */
092    boolean getTestOnReturn();
093    /**
094     * See {@link GenericObjectPool#getTestWhileIdle()}
095     * @return See {@link GenericObjectPool#getTestWhileIdle()}
096     */
097    boolean getTestWhileIdle();
098    /**
099     * See {@link GenericObjectPool#getTimeBetweenEvictionRunsMillis()}
100     * @return See {@link GenericObjectPool#getTimeBetweenEvictionRunsMillis()}
101     */
102    long getTimeBetweenEvictionRunsMillis();
103    /**
104     * See {@link GenericObjectPool#isClosed()}
105     * @return See {@link GenericObjectPool#isClosed()}
106     */
107    boolean isClosed();
108    // Getters for monitoring attributes
109    /**
110     * See {@link GenericObjectPool#getBorrowedCount()}
111     * @return See {@link GenericObjectPool#getBorrowedCount()}
112     */
113    long getBorrowedCount();
114    /**
115     * See {@link GenericObjectPool#getReturnedCount()}
116     * @return See {@link GenericObjectPool#getReturnedCount()}
117     */
118    long getReturnedCount();
119    /**
120     * See {@link GenericObjectPool#getCreatedCount()}
121     * @return See {@link GenericObjectPool#getCreatedCount()}
122     */
123    long getCreatedCount();
124    /**
125     * See {@link GenericObjectPool#getDestroyedCount()}
126     * @return See {@link GenericObjectPool#getDestroyedCount()}
127     */
128    long getDestroyedCount();
129    /**
130     * See {@link GenericObjectPool#getDestroyedByEvictorCount()}
131     * @return See {@link GenericObjectPool#getDestroyedByEvictorCount()}
132     */
133    long getDestroyedByEvictorCount();
134    /**
135     * See {@link GenericObjectPool#getDestroyedByBorrowValidationCount()}
136     * @return See {@link GenericObjectPool#getDestroyedByBorrowValidationCount()}
137     */
138    long getDestroyedByBorrowValidationCount();
139    /**
140     * See {@link GenericObjectPool#getMeanActiveTimeMillis()}
141     * @return See {@link GenericObjectPool#getMeanActiveTimeMillis()}
142     */
143    long getMeanActiveTimeMillis();
144    /**
145     * See {@link GenericObjectPool#getMeanIdleTimeMillis()}
146     * @return See {@link GenericObjectPool#getMeanIdleTimeMillis()}
147     */
148    long getMeanIdleTimeMillis();
149    /**
150     * See {@link GenericObjectPool#getMeanBorrowWaitTimeMillis()}
151     * @return See {@link GenericObjectPool#getMeanBorrowWaitTimeMillis()}
152     */
153    long getMeanBorrowWaitTimeMillis();
154    /**
155     * See {@link GenericObjectPool#getMaxBorrowWaitTimeMillis()}
156     * @return See {@link GenericObjectPool#getMaxBorrowWaitTimeMillis()}
157     */
158    long getMaxBorrowWaitTimeMillis();
159    /**
160     * See {@link GenericObjectPool#getCreationStackTrace()}
161     * @return See {@link GenericObjectPool#getCreationStackTrace()}
162     */
163    String getCreationStackTrace();
164    /**
165     * See {@link GenericObjectPool#getNumWaiters()}
166     * @return See {@link GenericObjectPool#getNumWaiters()}
167     */
168    int getNumWaiters();
169
170    // Getters for abandoned object removal configuration
171    /**
172     * See {@link GenericObjectPool#isAbandonedConfig()}
173     * @return See {@link GenericObjectPool#isAbandonedConfig()}
174     */
175    boolean isAbandonedConfig();
176    /**
177     * See {@link GenericObjectPool#getLogAbandoned()}
178     * @return See {@link GenericObjectPool#getLogAbandoned()}
179     */
180    boolean getLogAbandoned();
181    /**
182     * See {@link GenericObjectPool#getRemoveAbandonedOnBorrow()}
183     * @return See {@link GenericObjectPool#getRemoveAbandonedOnBorrow()}
184     */
185    boolean getRemoveAbandonedOnBorrow();
186    /**
187     * See {@link GenericObjectPool#getRemoveAbandonedOnMaintenance()}
188     * @return See {@link GenericObjectPool#getRemoveAbandonedOnMaintenance()}
189     */
190    boolean getRemoveAbandonedOnMaintenance();
191    /**
192     * See {@link GenericObjectPool#getRemoveAbandonedTimeout()}
193     * @return See {@link GenericObjectPool#getRemoveAbandonedTimeout()}
194     */
195    int getRemoveAbandonedTimeout();
196    /**
197     * See {@link GenericObjectPool#getFactoryType()}
198     * @return See {@link GenericObjectPool#getFactoryType()}
199     */
200    public String getFactoryType();
201    /**
202     * See {@link GenericObjectPool#listAllObjects()}
203     * @return See {@link GenericObjectPool#listAllObjects()}
204     */
205    Set<DefaultPooledObjectInfo> listAllObjects();
206}