1 23 24 29 30 package com.sun.enterprise.admin.mbeans.jvm; 31 32 import com.sun.enterprise.util.SystemPropertyConstants; 33 import javax.management.MBeanRegistration ; 34 import javax.management.MBeanServer ; 35 import javax.management.MBeanServerConnection ; 36 import javax.management.ObjectName ; 37 38 40 public class JVMInformation implements JVMInformationMBean, MBeanRegistration { 41 private MBeanServerConnection mbsc = null; 42 43 public JVMInformation() { 44 } 45 46 public String getThreadDump(String processName) { 47 final ThreadMonitor tm = new ThreadMonitor(mbsc); 48 return ( tm.getThreadDump() ); 49 } 50 51 public String getSummary(String processName) { 52 final SummaryReporter sr = new SummaryReporter(mbsc); 53 return ( sr.getSummaryReport() ); 54 } 55 56 public String getMemoryInformation(String processName) { 57 final MemoryReporter mr = new MemoryReporter(mbsc); 58 return ( mr.getMemoryReport() ); 59 } 60 61 public String getClassInformation(String processName) { 62 final ClassReporter cr = new ClassReporter(mbsc); 63 return ( cr.getClassReport() ); 64 } 65 66 public void postRegister(Boolean registrationDone) { 67 } 68 69 public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { 70 this.mbsc = server; 71 final String sn = System.getProperty(SystemPropertyConstants.SERVER_NAME); 72 final ObjectName on = JVMInformationCollector.formObjectName(sn, JVMInformation.class.getSimpleName()); 73 return ( on ); 74 } 75 76 public void preDeregister() throws Exception { 77 } 78 79 public void postDeregister() { 80 } 81 82 } 83 | Popular Tags |