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

JVMRuntimeStatsImpl

public class JVMRuntimeStatsImpl extends Object implements com.sun.enterprise.admin.monitor.stats.JVMRuntimeStats

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
upTime
private com.sun.enterprise.admin.monitor.stats.StringStatistic
name
private RuntimeMXBean
bean
final long
initTime
private static final com.sun.enterprise.util.i18n.StringManager
localStrMgr
Constructors Summary
public JVMRuntimeStatsImpl()
Creates a new instance of JVMRuntimeStatsImpl

    

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

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

        
        String bclasspath = bean.getBootClassPath();
        
        return new StringStatisticImpl(bclasspath, 
               localStrMgr.getString("monitor.stats.boot_class_path_string"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_boot_class_path"), 
               initTime,
               System.currentTimeMillis()); 
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetClassPath()

        
        String cpath = bean.getClassPath();
        
        return new StringStatisticImpl(cpath, 
               localStrMgr.getString("monitor.stats.class_path_string"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_class_path"), 
               initTime,
               System.currentTimeMillis()); 
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetInputArguments()

        
        ArrayList inputArgs = new ArrayList();
        inputArgs.addAll(bean.getInputArguments());
        
        return new StringStatisticImpl(inputArgs.toString (), 
               localStrMgr.getString("monitor.stats.input_args_string"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_input_args"), 
               initTime,
               System.currentTimeMillis()); 
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetLibraryPath()

        
        String libpath = bean.getLibraryPath();
        
        return new StringStatisticImpl(libpath, 
               localStrMgr.getString("monitor.stats.lib_path_string"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_lib_path"), 
               initTime,
               System.currentTimeMillis()); 
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetManagementSpecVersion()

        
        String ver = bean.getManagementSpecVersion();
        
        return new StringStatisticImpl(ver, 
               localStrMgr.getString("monitor.stats.lib_mgmt_spec_ver"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_mgmt_spec_ver"), 
               initTime,
               System.currentTimeMillis()); 
    
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_vm"), 
                   initTime,
                   System.currentTimeMillis()); 

    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetSpecName()

        
        String specname = bean.getSpecName();
        
        return new StringStatisticImpl(specname, 
               localStrMgr.getString("monitor.stats.spec_name"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_spec"), 
               initTime,
               System.currentTimeMillis()); 
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetSpecVendor()

        
        String specvendor = bean.getSpecVendor();
        
        return new StringStatisticImpl(specvendor, 
               localStrMgr.getString("monitor.stats.spec_vendor"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_spec_vendor"), 
               initTime,
               System.currentTimeMillis()); 
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetSpecVersion()

        
        String specver = bean.getSpecVersion();
        
        return new StringStatisticImpl(specver, 
               localStrMgr.getString("monitor.stats.jvm_spec_vers"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_jvm_spec_vers"), 
               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.CountStatisticgetUptime()

        long u = bean.getUptime();
        upTime.setCount (u);
        return (CountStatistic)upTime.unmodifiableView ();
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetVmName()

        
        String vmname = bean.getVmName();
        
        return new StringStatisticImpl(vmname, 
               localStrMgr.getString("monitor.stats.jvm_impl_name"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_jvm_impl"), 
               initTime,
               System.currentTimeMillis()); 
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetVmVendor()

        
        String vmvendor = bean.getVmVendor();
        
        return new StringStatisticImpl(vmvendor, 
               localStrMgr.getString("monitor.stats.jvm_vendor"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_jvm_vendor"), 
               initTime,
               System.currentTimeMillis()); 
    
public com.sun.enterprise.admin.monitor.stats.StringStatisticgetVmVersion()

        
        String vmver = bean.getVmVersion();
        
        return new StringStatisticImpl(vmver, 
               localStrMgr.getString("monitor.stats.jvm_vers"), 
               localStrMgr.getString("monitor.stats.string_units"), 
               localStrMgr.getString("monitor.stats.name_of_jvm_vers"), 
               initTime,
               System.currentTimeMillis()); 
    
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.milli_sec_units_desc"));
        upTime = new MutableCountStatisticImpl(c);