1 23 24 29 package com.sun.enterprise.management.config; 30 31 import java.util.Map ; 32 import java.util.HashMap ; 33 34 import javax.management.Attribute ; 35 import javax.management.AttributeList ; 36 37 import com.sun.appserv.management.config.ModuleMonitoringLevelsConfig; 38 import com.sun.appserv.management.util.jmx.JMXUtil; 39 import com.sun.enterprise.management.config.AMXConfigImplBase; 40 import com.sun.enterprise.management.support.Delegate; 41 42 45 public final class ModuleMonitoringLevelsConfigImpl extends AMXConfigImplBase 46 { 47 public 48 ModuleMonitoringLevelsConfigImpl( final Delegate delegate ) 49 { 50 super( delegate ); 51 } 52 53 private static final String [] MODULES = 54 { 55 "ConnectorConnectionPool", 56 "ThreadPool", 57 "HTTPService", 58 "JDBCConnectionPool", 59 "ORB", 60 "JVM", 61 "JMSService", 62 "ConnectorService", 63 "TransactionService", 64 "WebContainer", 65 "EJBContainer", 66 }; 67 68 public Map <String ,String > 69 getAllLevels() 70 { 71 final AttributeList attrs = getAttributes( MODULES ); 72 73 assert ( attrs.size() == MODULES.length ) : 74 "Missing some monitoring levels, have: " + toString( attrs ); 75 76 return( JMXUtil.attributeListToStringMap( attrs ) ); 77 } 78 79 public void 80 changeAll( final String state ) 81 { 82 final AttributeList allAttrs = new AttributeList (); 83 84 for( int i = 0; i < MODULES.length; ++i ) 85 { 86 allAttrs.add( new Attribute ( MODULES[ i ], state ) ); 87 } 88 89 setAttributes( allAttrs ); 90 } 91 92 } 93 94 | Popular Tags |