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

JVMCompilationStatsImpl

public class JVMCompilationStatsImpl extends Object implements com.sun.enterprise.admin.monitor.stats.JVMCompilationStats

Fields Summary
private com.sun.enterprise.admin.monitor.stats.GenericStatsImpl
baseStatsImpl
private static final String
STATS_INTERFACE_NAME
private MBeanServer
server
private com.sun.enterprise.admin.monitor.stats.MutableCountStatistic
compileTime
private com.sun.enterprise.admin.monitor.stats.StringStatistic
name
private CompilationMXBean
bean
final long
initTime
private static final com.sun.enterprise.util.i18n.StringManager
localStrMgr
Constructors Summary
public JVMCompilationStatsImpl()
Creates a new instance of JVMCompilationStatsImpl

    

           
      
        
        initTime = System.currentTimeMillis ();
        try {
            baseStatsImpl = new GenericStatsImpl(STATS_INTERFACE_NAME, this);
        } catch(Exception e) {
            
        }
        // get an instance of the MBeanServer
        // server = getPlatformMBeanServer();
        bean = ManagementFactory.getCompilationMXBean();
        
        // initialize all the MutableStatistic Classes
        initializeStatistics();

    
Methods Summary
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetName()

        
        String name = bean.getName();
        
        return new StringStatisticImpl(name, 
                   localStrMgr.getString("monitor.stats.name_string"), 
                   localStrMgr.getString("monitor.stats.string_units"), 
                   localStrMgr.getString("monitor.stats.name_of_jit_compiler"), 
                   initTime,
                   System.currentTimeMillis()); 
    
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();
    
public javax.management.j2ee.statistics.CountStatisticgetTotalCompilationTime()

        long cTime = bean.getTotalCompilationTime();
        compileTime.setCount (cTime);
        return (CountStatistic)compileTime.unmodifiableView ();
    
private voidinitializeStatistics()

        
       // Initialize the MutableCountStatistic for TotalCompilationTime
        CountStatistic c = new CountStatisticImpl( 
            localStrMgr.getString("monitor.stats.total_compilation_time"),
            localStrMgr.getString("monitor.stats.milli_sec_units"),
            localStrMgr.getString("monitor.stats.total_compilation_time_desc"));
        compileTime = new MutableCountStatisticImpl(c);