1 23 24 29 30 package com.sun.enterprise.management.config; 31 32 import java.util.Map ; 33 34 import javax.management.Attribute ; 35 import javax.management.AttributeList ; 36 37 import com.sun.enterprise.management.config.AMXConfigImplBase; 38 import com.sun.enterprise.management.support.Delegate; 39 40 import com.sun.appserv.management.util.jmx.JMXUtil; 41 42 43 46 47 import com.sun.appserv.management.config.ModuleLogLevelsConfig; 48 49 public final class ModuleLogLevelsConfigImpl extends AMXConfigImplBase 50 { 51 public 52 ModuleLogLevelsConfigImpl( final Delegate delegate ) 53 { 54 super( delegate ); 55 } 56 57 private static final String [] MODULES = 58 { 59 "Admin", 60 "Classloader", 61 "CMP", 62 "Configuration", 63 "Connector", 64 "CORBA", 65 "Deployment", 66 "EJBContainer", 67 "Javamail", 68 "JAXR", 69 "JAXRPC", 70 "JDO", 71 "JMS", 72 "JTA", 73 "JTS", 74 "MDBContainer", 75 "Naming", 76 "ResourceAdapter", 77 "Root", 78 "SAAJ", 79 "Security", 80 "Server", 81 "Verifier", 82 "WebContainer", 83 84 "Util", 86 "Synchronization", 87 "NodeAgent", 88 "SelfManagement", 89 "GroupManagementService", 90 }; 91 92 public Map 93 getAllLevels() 94 { 95 final AttributeList attrs = getAttributes( MODULES ); 96 97 assert ( attrs.size() == MODULES.length ) : 98 "Missing some log levels, have: " + toString( attrs ); 99 100 return( JMXUtil.attributeListToValueMap( attrs ) ); 101 } 102 103 public void 104 changeAll( final String level ) 105 { 106 final AttributeList allAttrs = new AttributeList (); 107 108 for( int i = 0; i < MODULES.length; ++i ) 109 { 110 allAttrs.add( new Attribute ( MODULES[ i ], level ) ); 111 } 112 113 setAttributes( allAttrs ); 114 } 115 116 117 118 } | Popular Tags |