1 23 package com.sun.enterprise.management.support; 24 25 import javax.management.ObjectName ; 26 27 import java.util.Set ; 28 import java.util.Map ; 29 import java.util.HashMap ; 30 31 import java.io.IOException ; 32 33 import javax.management.j2ee.statistics.Statistic ; 34 import javax.management.j2ee.statistics.Stats ; 35 import javax.management.j2ee.statistics.CountStatistic ; 36 import javax.management.j2ee.statistics.BoundaryStatistic ; 37 import javax.management.j2ee.statistics.RangeStatistic ; 38 import javax.management.j2ee.statistics.BoundedRangeStatistic ; 39 import javax.management.j2ee.statistics.TimeStatistic ; 40 41 import com.sun.appserv.management.util.j2ee.J2EEUtil; 42 import com.sun.appserv.management.util.jmx.JMXUtil; 43 import com.sun.appserv.management.base.Util; 44 45 import com.sun.appserv.management.j2ee.statistics.*; 46 47 48 import com.sun.enterprise.management.AMXTestBase; 49 import com.sun.enterprise.management.Capabilities; 50 51 55 public class ComSunAppservTest 56 extends AMXTestBase 57 { 58 public 59 ComSunAppservTest() 60 { 61 } 62 63 66 public Map <String ,ObjectName > 67 getAllComSunAppservCategory( final String category ) 68 throws IOException 69 { 70 final ObjectName pattern = 71 Util.newObjectName( "com.sun.appserv:category=" + category + ",*"); 72 final Set <ObjectName > objectNames = 73 JMXUtil.queryNames( getMBeanServerConnection(), pattern, null ); 74 75 final HashMap <String ,ObjectName > m = new HashMap <String ,ObjectName >(); 76 for( final ObjectName objectName : objectNames ) 77 { 78 final String type = objectName.getKeyProperty( "type" ); 79 if ( type != null ) 80 { 81 m.put( type, objectName ); 82 } 83 } 84 85 return m; 86 } 87 88 public Map <String ,ObjectName > 89 getAllComSunAppservMonitor() 90 throws java.io.IOException 91 { 92 return getAllComSunAppservCategory( "monitor" ); 93 } 94 95 public Map <String ,ObjectName > 96 getAllComSunAppservConfig() 97 throws java.io.IOException 98 { 99 return getAllComSunAppservCategory( "config" ); 100 } 101 102 103 104 } 105 106 107 108 109 110 111 | Popular Tags |