[jboss-cvs] JBossAS SVN: r60228 - branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 2 18:30:08 EST 2007


Author: bdecoste
Date: 2007-02-02 18:30:08 -0500 (Fri, 02 Feb 2007)
New Revision: 60228

Modified:
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache/NoPassivationCache.java
   branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache/StatefulCache.java
Log:
JMX metrics on container for session beans

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache/NoPassivationCache.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache/NoPassivationCache.java	2007-02-02 23:29:38 UTC (rev 60227)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache/NoPassivationCache.java	2007-02-02 23:30:08 UTC (rev 60228)
@@ -39,6 +39,7 @@
 {
    private Pool pool;
    private HashMap cacheMap;
+   protected int createCount = 0;
 
    public void initialize(Container container) throws Exception
    {
@@ -68,6 +69,7 @@
       try
       {
          ctx = (StatefulBeanContext) pool.get();
+         ++createCount;
          synchronized (cacheMap)
          {
             cacheMap.put(ctx.getId(), ctx);
@@ -143,5 +145,19 @@
       if (ctx != null) pool.remove(ctx);
    }
 
+   public int getCacheSize()
+   {
+	   return cacheMap.size();
+   }
+   
+   public int getCreateCount()
+   {
+	   return createCount;
+   }
+   
+   public int getPassivatedCount()
+   {
+	   return 0;
+   }
 
 }

Modified: branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache/StatefulCache.java
===================================================================
--- branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache/StatefulCache.java	2007-02-02 23:29:38 UTC (rev 60227)
+++ branches/Branch_4_2/ejb3/src/main/org/jboss/ejb3/cache/StatefulCache.java	2007-02-02 23:30:08 UTC (rev 60228)
@@ -51,4 +51,10 @@
    void start();
 
    void stop();
+   
+   int getCacheSize();
+   
+   int getCreateCount();
+   
+   int getPassivatedCount();
 }




More information about the jboss-cvs-commits mailing list