FileDocCategorySizeDatePackage
JVMGarbageCollectorStatsImpl.javaAPI DocGlassfish v2 API5788Fri May 04 22:24:20 BST 2007com.sun.enterprise.admin.monitor.stats.spi

JVMGarbageCollectorStatsImpl

public class JVMGarbageCollectorStatsImpl extends Object implements com.sun.enterprise.admin.monitor.stats.JVMGarbageCollectorStats

Fields Summary
private com.sun.enterprise.admin.monitor.stats.GenericStatsImpl
baseStatsImpl
private static final String
STATS_INTERFACE_NAME
private com.sun.enterprise.admin.monitor.stats.MutableCountStatistic
collectionCount
private com.sun.enterprise.admin.monitor.stats.MutableCountStatistic
collectionTime
private GarbageCollectorMXBean
bean
private static final com.sun.enterprise.util.i18n.StringManager
localStrMgr
Constructors Summary
public JVMGarbageCollectorStatsImpl(GarbageCollectorMXBean gcMXBean)
Creates a new instance of JVMGarbageCollectorStatsImpl

    

           
       
        
        try {
            baseStatsImpl = new GenericStatsImpl(STATS_INTERFACE_NAME, this);
        } catch(Exception e) {
            
        }
        // get an instance of the MBeanServer
        // server = getPlatformMBeanServer();
        bean = gcMXBean;
        
        // initialize all the MutableStatistic Classes
        initializeStatistics();
    
Methods Summary
public javax.management.j2ee.statistics.CountStatisticgetCollectionCount()

        long collCount = bean.getCollectionCount();
        collectionCount.setCount (collCount);
        return (CountStatistic)collectionCount.unmodifiableView ();
    
public javax.management.j2ee.statistics.CountStatisticgetCollectionTime()

        long collTime = bean.getCollectionTime();
        collectionTime.setCount (collTime);
        return (CountStatistic)collectionTime.unmodifiableView ();
    
public javax.management.j2ee.statistics.StatisticgetStatistic(java.lang.String str)
queries for a Statistic by name.

return
Statistic

        return baseStatsImpl.getStatistic(str);
    
public java.lang.String[]getStatisticNames()
returns an array of names of all the Statistics, that can be retrieved from this implementation of Stats

return
String[]

        return baseStatsImpl.getStatisticNames();
    
public javax.management.j2ee.statistics.Statistic[]getStatistics()
This method can be used to retrieve all the Statistics, exposed by this implementation of Stats

return
Statistic[]

        return baseStatsImpl.getStatistics();
    
private voidinitializeStatistics()

        
       // Initialize the MutableCountStatistic for CollectionCount
        CountStatistic c = new CountStatisticImpl(
            localStrMgr.getString("monitor.stats.collection_cnt"),
            StatisticImpl.DEFAULT_UNIT,
            localStrMgr.getString("monitor.stats.collection_cnt_desc"));
        collectionCount = new MutableCountStatisticImpl(c);

       // Initialize the MutableCountStatistic for CollectionTime
        c = new CountStatisticImpl(
            localStrMgr.getString("monitor.stats.collection_time"), 
            localStrMgr.getString("monitor.stats.milli_sec_units"),
            localStrMgr.getString("monitor.stats.collection_time_desc"));
        collectionTime = new MutableCountStatisticImpl(c);