FileDocCategorySizeDatePackage
ClassReporter.javaAPI DocGlassfish v2 API3943Fri May 04 22:24:10 BST 2007com.sun.enterprise.admin.mbeans.jvm

ClassReporter

public class ClassReporter extends Object

Fields Summary
private final MBeanServerConnection
mbsc
private final com.sun.enterprise.util.i18n.StringManager
sm
Constructors Summary
public ClassReporter(MBeanServerConnection mbsc)

        
        this.mbsc = mbsc;
    
Methods Summary
public java.lang.StringgetClassReport()

        try {
            final StringBuilderNewLineAppender sb = new StringBuilderNewLineAppender(new StringBuilder());
            final ClassLoadingMXBean clmb = ManagementFactory.newPlatformMXBeanProxy(mbsc, 
                    ManagementFactory.CLASS_LOADING_MXBEAN_NAME, ClassLoadingMXBean.class);
            sb.append(sm.getString("classloading.info"));
            sb.append(sm.getString("classes.loaded", clmb.getLoadedClassCount()));
            sb.append(sm.getString("classes.total", clmb.getTotalLoadedClassCount()));
            sb.append(sm.getString("classes.unloaded", clmb.getUnloadedClassCount()));
            
            final CompilationMXBean cmb = ManagementFactory.newPlatformMXBeanProxy(mbsc, 
                    ManagementFactory.COMPILATION_MXBEAN_NAME, CompilationMXBean.class);
            sb.append(sm.getString("complilation.info"));
            sb.append(sm.getString("compilation.monitor.status", cmb.isCompilationTimeMonitoringSupported()));
            sb.append(sm.getString("jit.compilar.name", cmb.getName()));
            sb.append(sm.getString("compilation.time", JVMInformationCollector.millis2HoursMinutesSeconds(cmb.getTotalCompilationTime())));
            return ( sb.toString() );
        } catch(final Exception e) {
            throw new RuntimeException(e);
        }