KickJava   Java API By Example, From Geeks To Geeks.

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


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 package com.sun.enterprise.management.config;
24
25 import java.util.Map JavaDoc;
26 import java.util.HashMap JavaDoc;
27 import java.util.Set JavaDoc;
28
29 import javax.management.ObjectName JavaDoc;
30 import javax.management.AttributeList JavaDoc;
31
32
33 import com.sun.appserv.management.config.WebServiceEndpointConfig;
34 import com.sun.appserv.management.config.WebServiceEndpointConfigKeys;
35 import com.sun.appserv.management.util.misc.GSetUtil;
36 import com.sun.appserv.management.base.Util;
37
38 import com.sun.appserv.management.util.misc.TypeCast;
39
40
41 final class WebServiceEndpointConfigFactory extends ConfigFactory
42 {
43         public
44     WebServiceEndpointConfigFactory(
45         final ConfigFactoryCallback callbacks )
46     {
47         super( callbacks );
48     }
49
50         private final Set JavaDoc<String JavaDoc> LEGAL_OPTIONAL_KEYS =
51         GSetUtil.newUnmodifiableStringSet(
52             WebServiceEndpointConfigKeys.MONITORING_LEVEL_KEY,
53             WebServiceEndpointConfigKeys.JBI_ENABLED_KEY,
54             WebServiceEndpointConfigKeys.MAX_HISTORY_SIZE_KEY
55     );
56
57                 
58         protected Set JavaDoc<String JavaDoc>
59     getLegalOptionalCreateKeys()
60     {
61         return( LEGAL_OPTIONAL_KEYS );
62     }
63
64         protected Map JavaDoc<String JavaDoc,String JavaDoc>
65     getParamNameOverrides()
66     {
67         Map JavaDoc<String JavaDoc,String JavaDoc> m = new HashMap JavaDoc<String JavaDoc,String JavaDoc>();
68         m.put(WebServiceEndpointConfigKeys.MONITORING_LEVEL_KEY, "Monitoring");
69         m.put(WebServiceEndpointConfigKeys.JBI_ENABLED_KEY, "JbiEnabled");
70
71         return( m );
72     }
73
74   /**
75         The caller is responsible for dealing with any Properties.
76      */

77         protected ObjectName JavaDoc
78     createOldChildConfig(
79         final AttributeList JavaDoc translatedAttrs )
80     {
81         final ObjectName JavaDoc oldObjectName = (ObjectName JavaDoc)
82         getCallbacks().getDelegate().invoke(
83             CREATE_WEB_SERVICE_ENDPOINT, new Object JavaDoc[] { translatedAttrs },
84             CREATE_WEB_SERVICE_ENDPOINT_SIG );
85         
86         return oldObjectName;
87
88     }
89
90         public ObjectName JavaDoc
91     create(
92         final String JavaDoc name,
93         final Map JavaDoc<String JavaDoc,String JavaDoc> optional )
94     {
95         final Map JavaDoc<String JavaDoc,String JavaDoc> params = initParams(name, null, optional);
96
97         trace( "params as processed: " + stringify( params ) );
98
99         final ObjectName JavaDoc amxName = createChild( params );
100         
101         return( amxName );
102     }
103
104
105         public void
106     internalRemove( final ObjectName JavaDoc wseConfigObjectName )
107     {
108          final String JavaDoc name = Util.getName( wseConfigObjectName );
109
110         getCallbacks().getDelegate().invoke( REMOVE_WEB_SERVICE_ENDPOINT, new
111         Object JavaDoc[] { name }, REMOVE_WEB_SERVICE_ENDPOINT_SIG );
112         getCallbacks().sendConfigRemovedNotification( wseConfigObjectName );
113     }
114
115
116         private static final String JavaDoc CREATE_WEB_SERVICE_ENDPOINT =
117         "createWebServiceEndpoint";
118         private static final String JavaDoc[] CREATE_WEB_SERVICE_ENDPOINT_SIG = new String JavaDoc[] { AttributeList JavaDoc.class.getName() };
119           private static final String JavaDoc REMOVE_WEB_SERVICE_ENDPOINT =
120             "removeWebServiceEndpointByName";
121         private static final String JavaDoc[] REMOVE_WEB_SERVICE_ENDPOINT_SIG =
122             new String JavaDoc[] { String JavaDoc.class.getName() };
123
124
125 }
126
127
128
129
130
131
Popular Tags