Index: src/main/org/jboss/ejb/plugins/AbstractInstancePool.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractInstancePool.java,v retrieving revision 1.37 diff -u -r1.37 AbstractInstancePool.java --- src/main/org/jboss/ejb/plugins/AbstractInstancePool.java 6 Aug 2005 00:35:24 -0000 1.37 +++ src/main/org/jboss/ejb/plugins/AbstractInstancePool.java 19 Sep 2005 12:10:11 -0000 @@ -60,8 +60,11 @@ protected int maxSize = 30; /** determine if we reuse EnterpriseContext objects i.e. if we actually do pooling */ protected boolean reclaim = false; - - + /** waiting threads for this pool */ + private int waiting = 0; + /** max amount of waiting threads for this pool */ + private int maxWaiting = 0; + // Static -------------------------------------------------------- // Constructors -------------------------------------------------- @@ -123,6 +126,24 @@ } /** + * @jmx:managed-attribute + * @return the amount of waiting threads for this pool + */ + public int getWaiting() + { + return waiting; + } + + /** + * @jmx:managed-attribute + * @return maximum number of waiting threads for this pool + */ + public int getMaxWaiting() + { + return maxWaiting; + } + + /** * Get an instance without identity. * Can be used by finders,create-methods, and activation * @@ -139,7 +160,13 @@ if( strictMaxSize != null ) { // Block until an instance is available + waiting++; + if (waiting > maxWaiting) + { + maxWaiting = waiting; + } boolean acquired = strictMaxSize.attempt(strictTimeout); + waiting--; if( trace ) log.trace("Acquired("+acquired+") strictMaxSize semaphore, remaining="+strictMaxSize.permits()); if( acquired == false ) Index: src/main/org/jboss/ejb/plugins/AbstractInstancePoolMBean.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractInstancePoolMBean.java,v retrieving revision 1.2 diff -u -r1.2 AbstractInstancePoolMBean.java --- src/main/org/jboss/ejb/plugins/AbstractInstancePoolMBean.java 6 Aug 2005 00:35:24 -0000 1.2 +++ src/main/org/jboss/ejb/plugins/AbstractInstancePoolMBean.java 19 Sep 2005 12:10:11 -0000 @@ -17,4 +17,15 @@ /** Clear the pool - does not remove inuse contexts */ void clear(); + + /** + * @return the amount of waiting threads for this pool + */ + int getWaiting(); + + /** + * @return maximum number of waiting threads for this pool + */ + int getMaxWaiting(); + }