[jboss-dev-forums] [Design of JCA on JBoss] - Re: JBAS-1808 - MCF MBeans

vickyk do-not-reply at jboss.com
Sat Feb 16 13:37:52 EST 2008


"vickyk" wrote : 
  | Looking at the original requirement I could think of pulling the PreparedStatementCache from the JbossManagedConnectionPool MBean per DataSource.
  | As per the original requirement we need to 
  | 1) Get all the ManagedConnection from the Pool.
  | 2) Find out the PreparedStatementCache associated with these ManagedConneciton in the pool.
  | 
  | Here I see the related data being pulled from the JbossManagedConnectionPool/InternalManagedConnectionPool .
  | 
  | 
Adrian , I have tried this option .

I tried this code in the JbossManagedConnectionPool 
+      public Object listUnderlyingNativeConnectionStatistics()
  | +      {
  | +         String statistics = "";
  | +         for(Iterator iter = subPools.values().iterator(); iter.hasNext();)
  | +          {                      
  | +                 SubPoolContext subContext = (SubPoolContext)iter.next();
  | +                 InternalManagedConnectionPool internalPool = subContext.getSubPool();
  | +              java.util.ArrayList cels = internalPool.getCELs();
  | +              int connectionCount = cels.size();
  | +              for(int i=0;i<connectionCount;i++)
  | +              {
  | +                ConnectionListener cl = (ConnectionListener) cels.get(i);
  | +                javax.resource.spi.ManagedConnection mc = cl.getManagedConnection();
  | +                if (mc instanceof org.jboss.resource.statistic.JBossConnectionStatistics)
  | +                {
  | +                       org.jboss.resource.statistic.JBossConnectionStatistics stats = (org.jboss.resource.statistic.JBossConnectionStatistics)mc;
  | +                       statistics += stats.listConnectionStats();
  | +                }
  | +                else
  | +                {
  | +                        statistics = mc + " does not implement org.jboss.resource.statistic.JBossConnectionStatistics , <br><font color='red'>So this Operation is Not available!!!</font> ";
  | +                        break;                          
  | +                }
  | +              }
  | +          }
  | +         return statistics;
  | +      }
  | 
With this approach we can expose the underlying connection specific statistics in the JbossManagedConnectionPool MBean .
The required statistics should be formated in the the listUnderlyingNativeConnectionStatistics() method and the ManagedConnection should implement JbossConnectionStatistics .
Before I go fully on this I would like to know your opinion on this .


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129837#4129837

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129837



More information about the jboss-dev-forums mailing list