KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > config > ModuleLogLevelsConfigImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /**
25     Generated: Fri Jan 30 18:44:42 PST 2004
26     Generated from:
27     com.sun.appserv:type=module-log-levels,config=server-config,category=config
28 */

29
30 package com.sun.enterprise.management.config;
31
32 import java.util.Map JavaDoc;
33
34 import javax.management.Attribute JavaDoc;
35 import javax.management.AttributeList JavaDoc;
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 /**
44     Configuration for the <module-log-levels> element.
45 */

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 JavaDoc[] 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         // 9.0
85
"Util",
86         "Synchronization",
87         "NodeAgent",
88         "SelfManagement",
89         "GroupManagementService",
90     };
91     
92         public Map JavaDoc
93     getAllLevels()
94     {
95         final AttributeList JavaDoc 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 JavaDoc level )
105     {
106         final AttributeList JavaDoc allAttrs = new AttributeList JavaDoc();
107         
108         for( int i = 0; i < MODULES.length; ++i )
109         {
110             allAttrs.add( new Attribute JavaDoc( MODULES[ i ], level ) );
111         }
112         
113         setAttributes( allAttrs );
114     }
115
116     
117
118 }
Popular Tags