001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.resource.connectionmanager;
023:
024: /**
025: * A JBossManagedConnectionPoolMBean.
026: *
027: * @author <a href="adrian@jboss.com">Adrian Brock</a>
028: * @author <a href="weston.price@jboss.com">Weston Price</a>
029: *
030: * @version $Revision: 59880 $
031: */
032: public interface JBossManagedConnectionPoolMBean extends
033: org.jboss.system.ServiceMBean {
034:
035: //default object name
036: public static final javax.management.ObjectName OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory
037: .create("jboss.jca:service=JBossManagedConnectionPool");
038:
039: /**
040: * ManagedConnectionPool is a read only attribute returning the pool set up by this mbean.
041: * @return the ManagedConnectionPool implementing the pool configured by this mbean.
042: */
043: org.jboss.resource.connectionmanager.ManagedConnectionPool getManagedConnectionPool();
044:
045: /**
046: * ManagedConnectionFactoryName holds the ObjectName of the mbean that represents the ManagedConnectionFactory. Normally this can be an embedded mbean in a depends element rather than a separate mbean reference.
047: * @return the ManagedConnectionFactoryName value.
048: */
049: javax.management.ObjectName getManagedConnectionFactoryName();
050:
051: /**
052: * Set the ManagedConnectionFactoryName value.
053: * @param newManagedConnectionFactoryName The new ManagedConnectionFactoryName value.
054: */
055: void setManagedConnectionFactoryName(
056: javax.management.ObjectName newManagedConnectionFactoryName);
057:
058: /**
059: * Get number of available free connections
060: * @return number of available connections
061: */
062: long getAvailableConnectionCount();
063:
064: long getMaxConnectionsInUseCount();
065:
066: /**
067: * Get number of connections currently in use
068: * @return number of connections currently in use
069: */
070: long getInUseConnectionCount();
071:
072: /**
073: * The MinSize attribute indicates the minimum number of connections this pool should hold. These are not created until a Subject is known from a request for a connection. MinSize connections will be created for each sub-pool.
074: * @return the MinSize value.
075: */
076: int getMinSize();
077:
078: /**
079: * Set the MinSize value.
080: * @param newMinSize The new MinSize value.
081: */
082: void setMinSize(int newMinSize);
083:
084: /**
085: * The MaxSize attribute indicates the maximum number of connections for a pool. No more than MaxSize connections will be created in each sub-pool.
086: * @return the MaxSize value.
087: */
088: int getMaxSize();
089:
090: /**
091: * Set the MaxSize value.
092: * @param newMaxSize The new MaxSize value.
093: */
094: void setMaxSize(int newMaxSize);
095:
096: /**
097: * The BlockingTimeoutMillis attribute indicates the maximum time to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and will never throw an exception if creating a new connection takes an inordinately long time.
098: * @return the BlockingTimeout value.
099: */
100: int getBlockingTimeoutMillis();
101:
102: /**
103: * Set the BlockingTimeout value.
104: * @param newBlockingTimeout The new BlockingTimeout value.
105: */
106: void setBlockingTimeoutMillis(int newBlockingTimeout);
107:
108: /**
109: * The IdleTimeoutMinutes attribute indicates the maximum time a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is 1/2 the smallest IdleTimeout of any pool.
110: * @return the IdleTimeoutMinutes value.
111: */
112: long getIdleTimeoutMinutes();
113:
114: /**
115: * Set the IdleTimeoutMinutes value.
116: * @param newIdleTimeoutMinutes The new IdleTimeoutMinutes value.
117: */
118: void setIdleTimeoutMinutes(long newIdleTimeoutMinutes);
119:
120: /**
121: * The Criteria attribute indicates if Subject (from security domain) or app supplied parameters (such as from getConnection(user, pw)) are used to distinguish connections in the pool. Choices are ByContainerAndApplication (use both), ByContainer (use Subject), ByApplication (use app supplied params only), ByNothing (all connections are equivalent, usually if adapter supports reauthentication)
122: * @return the Criteria value.
123: */
124: java.lang.String getCriteria();
125:
126: /**
127: * Set the Criteria value.
128: * @param newCriteria The new Criteria value.
129: */
130: void setCriteria(java.lang.String newCriteria);
131:
132: /**
133: * Separate pools for transactional use
134: * @return true when connections should have different pools for transactional and non-transaction use.
135: */
136: boolean getNoTxSeparatePools();
137:
138: void setNoTxSeparatePools(boolean value);
139:
140: /**
141: * The <code>flush</code> method puts all currently checked out connections on a list to be destroyed when returned and disposes of all current pooled connections.
142: */
143: void flush();
144:
145: /**
146: * Retrieve the connection count.
147: * @return the connection count
148: */
149: int getConnectionCount();
150:
151: /**
152: * Retrieve the connection created count.
153: * @return the connection created count
154: */
155: int getConnectionCreatedCount();
156:
157: /**
158: * Retrieve the destrooyed count.
159: * @return the destroyed count
160: */
161: int getConnectionDestroyedCount();
162:
163: /**
164: * Get background validation
165: *
166: * @return true of false if background validation is enabled.
167: */
168: public boolean getBackGroundValidation();
169:
170: /**
171: * Set the background validation
172: *
173: * @param backgroundValidation true or false if background validation is to be enabled
174: */
175: public void setBackGroundValidation(boolean backgroundValidation);
176:
177: /**
178: * Set the background validation in minutes
179: *
180: * @param backgroundValidationInterval the background interval in minutes
181: */
182: public void setBackGroundValidationMinutes(
183: long backgroundValidationInterval);
184:
185: /**
186: * Get the background validation in minutes
187: *
188: * @return the background validation in minutes
189: */
190: public long getBackGroundValidationMinutes();
191:
192: /**
193: * Get prefill
194: *
195: * @return true or false depending upon prefill being set
196: */
197: public boolean getPreFill();
198:
199: /**
200: * Set the prefill
201: *
202: * @param prefill true or false depending upon if prefill is being used
203: */
204: public void setPreFill(boolean prefill);
205:
206: /**
207: * Get the jndi name of the pool
208: *
209: * @return the jndi name of the pool.
210: */
211: public String getPoolJndiName();
212:
213: /**
214: * Set the jndi name of the pool.
215: *
216: * @param poolName the jndi name of the pool.
217: */
218: public void setPoolJndiName(String poolName);
219:
220: /**
221: * Whether or not we want to immeadiately create a new connection when
222: * an attempt to acquire a connection from the pool fails.
223: *
224: * @return true of false depending upon whether fast fail is being used.
225: *
226: */
227: public boolean getUseFastFail();
228:
229: /**
230: * Indicate whether or not we want to immeadiately create a new connection when
231: * an attempt to acquire a connection from the pool fails.
232: *
233: *
234: * @param useFastFail whether or not we want to use fast fail semantics in a connection attempt.
235: */
236: public void setUseFastFail(boolean useFastFail);
237:
238: }
|