1 29 30 package com.caucho.management.j2ee; 31 32 import com.caucho.server.resin.Resin; 33 import com.caucho.server.util.CauchoSystem; 34 35 import javax.management.j2ee.statistics.BoundedRangeStatistic ; 36 import javax.management.j2ee.statistics.CountStatistic ; 37 import javax.management.j2ee.statistics.JVMStats ; 38 39 42 public class JVM 43 extends J2EEManagedObject 44 implements StatisticsProvider<JVMStats > 45 { 46 public JVM() 47 { 48 } 49 50 protected String getName() 51 { 52 String name = Resin.getLocal().getServerId(); 53 54 return (name == null) ? "" : name; 55 } 56 57 protected boolean isJ2EEApplication() 58 { 59 return false; 60 } 61 62 65 public String getJavaVersion() 66 { 67 return System.getProperty("java.version"); 68 } 69 70 73 public String getJavaVendor() 74 { 75 return System.getProperty("java.vendor"); 76 } 77 78 82 public String getNode() 83 { 84 return CauchoSystem.getLocalHost(); 85 } 86 87 public JVMStats getStats() 88 { 89 return new JVMStatsImpl(this); 90 } 91 92 class JVMStatsImpl 93 extends StatsSupport 94 implements JVMStats 95 { 96 public JVMStatsImpl(J2EEManagedObject j2eeManagedObject) 97 { 98 super(j2eeManagedObject); 99 } 100 101 public BoundedRangeStatistic getHeapSize() 102 { 103 return new UnimplementedBoundedRangeStatistic("HeapSize"); 104 } 105 106 public CountStatistic getUpTime() 107 { 108 return new UnimplementedCountStatistic("UpTime"); 109 } 110 } 111 } 112 | Popular Tags |