FileDocCategorySizeDatePackage
BeanCacheMonitorTest.javaAPI DocGlassfish v2 API4379Fri May 04 22:24:06 BST 2007com.sun.enterprise.management.monitor

BeanCacheMonitorTest

public final class BeanCacheMonitorTest extends AMXMonitorTestBase

Fields Summary
Constructors Summary
public BeanCacheMonitorTest()

    
Methods Summary
public voidtestStats()

  		final QueryMgr	q	= getQueryMgr();
  		
  		final Set	beanCacheMonitors	= q.queryJ2EETypeSet( XTypes.BEAN_CACHE_MONITOR );
  		
  		if (  beanCacheMonitors.size() == 0 )
  		{
  			warning( "BeanCacheMonitorTest: no MBeans found to test." );
  		}
  		else
  		{
  			final Iterator	iter	= beanCacheMonitors.iterator();
  			
  			while ( iter.hasNext() )
  			{
  				final BeanCacheMonitor	m	= (BeanCacheMonitor)iter.next();
  				final EJBCacheStats		s	= m.getEJBCacheStats();
  				
  				// verify that we can get each Statistic; there was a problem at one time
			  	final BoundedRangeStatistic b1	= s.getCacheMisses();
			    final BoundedRangeStatistic b2	= s.getCacheHits();
			    final BoundedRangeStatistic b3	= s.getBeansInCache();
			    
			    // these were failing
			    final CountStatistic c4 = s.getPassivationSuccesses();
			    final CountStatistic c3	= s.getExpiredSessionsRemoved();
			    final CountStatistic c2	= s.getPassivationErrors();
			    final CountStatistic c1	= s.getPassivations();

  			}
  		}