KickJava   Java API By Example, From Geeks To Geeks.

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


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  * $Header: /cvs/glassfish/admin/mbeanapi-impl/src/java/com/sun/enterprise/management/config/ModuleLogLevelsConfigFactory.java,v 1.5 2006/03/09 20:30:40 llc Exp $
26  * $Revision: 1.5 $
27  * $Date: 2006/03/09 20:30:40 $
28  */

29
30
31 package com.sun.enterprise.management.config;
32
33 import java.util.Map JavaDoc;
34 import java.util.Set JavaDoc;
35 import java.util.Collections JavaDoc;
36
37 import javax.management.ObjectName JavaDoc;
38 import javax.management.AttributeList JavaDoc;
39
40 import com.sun.enterprise.management.support.oldconfig.OldLogServiceMBean;
41
42 import com.sun.appserv.management.util.misc.GSetUtil;
43 import com.sun.appserv.management.config.ModuleLogLevelsConfigKeys;
44
45 public final class ModuleLogLevelsConfigFactory extends ConfigFactory
46 {
47     private final OldLogServiceMBean mOldLogServiceMBean;
48     
49         public
50     ModuleLogLevelsConfigFactory(
51         final ConfigFactoryCallback callbacks,
52         final OldLogServiceMBean old )
53     {
54         super( callbacks );
55         
56         mOldLogServiceMBean = old;
57     }
58     
59     
60     private final Set JavaDoc<String JavaDoc> LEGAL_OPTIONAL_KEYS =
61         GSetUtil.newUnmodifiableStringSet(
62         ModuleLogLevelsConfigKeys.ROOT_KEY,
63         ModuleLogLevelsConfigKeys.SERVER_KEY,
64         ModuleLogLevelsConfigKeys.EJB_CONTAINER_KEY,
65         ModuleLogLevelsConfigKeys.CMP_CONTAINER_KEY,
66         ModuleLogLevelsConfigKeys.MDB_CONTAINER_KEY,
67         ModuleLogLevelsConfigKeys.WEB_CONTAINER_KEY,
68         ModuleLogLevelsConfigKeys.CLASSLOADER_KEY,
69         ModuleLogLevelsConfigKeys.CONFIGURATION_KEY,
70         ModuleLogLevelsConfigKeys.NAMING_KEY,
71         ModuleLogLevelsConfigKeys.SECURITY_KEY,
72         ModuleLogLevelsConfigKeys.JTS_KEY,
73         ModuleLogLevelsConfigKeys.JTA_KEY,
74         ModuleLogLevelsConfigKeys.ADMIN_KEY,
75         ModuleLogLevelsConfigKeys.DEPLOYMENT_KEY,
76         ModuleLogLevelsConfigKeys.VERIFIER_KEY,
77         ModuleLogLevelsConfigKeys.JAXR_KEY,
78         ModuleLogLevelsConfigKeys.JAXRPC_KEY,
79         ModuleLogLevelsConfigKeys.SAAJ_KEY,
80         ModuleLogLevelsConfigKeys.CORBA_KEY,
81         ModuleLogLevelsConfigKeys.JAVAMAIL_KEY,
82         ModuleLogLevelsConfigKeys.JMS_KEY,
83         ModuleLogLevelsConfigKeys.CONNECTOR_KEY,
84         ModuleLogLevelsConfigKeys.JDO_KEY,
85         ModuleLogLevelsConfigKeys.CMP_KEY,
86         ModuleLogLevelsConfigKeys.UTIL_KEY,
87         ModuleLogLevelsConfigKeys.RESOURCE_ADAPTER_KEY,
88         ModuleLogLevelsConfigKeys.SYNCHRONIZATION_KEY,
89         ModuleLogLevelsConfigKeys.NODE_AGENT_KEY );
90     
91         protected Set JavaDoc<String JavaDoc>
92     getLegalOptionalCreateKeys()
93     {
94         return( LEGAL_OPTIONAL_KEYS );
95     }
96     
97         public ObjectName JavaDoc
98     create( Map JavaDoc<String JavaDoc,String JavaDoc> optional )
99     {
100         final Map JavaDoc<String JavaDoc,String JavaDoc> params = initParams( optional );
101
102         final ObjectName JavaDoc amxName = createChild( params );
103         
104         return( amxName );
105     }
106
107         protected ObjectName JavaDoc
108     createOldChildConfig( String JavaDoc oldType, AttributeList JavaDoc attrs )
109     {
110         final ObjectName JavaDoc old = mOldLogServiceMBean.createModuleLogLevels( attrs );
111         return old;
112     }
113
114         protected void
115     internalRemove( final ObjectName JavaDoc objectName )
116     {
117         mOldLogServiceMBean.removeModuleLogLevels();
118     }
119
120 }
121
122
Popular Tags