KickJava   Java API By Example, From Geeks To Geeks.

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


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  */

26
27
28 package com.sun.enterprise.management.config;
29
30 import java.util.Map JavaDoc;
31 import java.util.Set JavaDoc;
32 import java.util.Collections JavaDoc;
33
34 import javax.management.ObjectName JavaDoc;
35 import javax.management.AttributeList JavaDoc;
36 import javax.management.Attribute JavaDoc;
37
38 import com.sun.appserv.management.util.misc.GSetUtil;
39 import com.sun.appserv.management.config.LBConfigKeys;
40
41 public final class LBConfigFactory extends ConfigFactory {
42
43     public LBConfigFactory(final ConfigFactoryCallback callbacks) {
44         super(callbacks);
45     }
46
47     private final Set JavaDoc<String JavaDoc> LEGAL_OPTIONAL_KEYS =
48         GSetUtil.newUnmodifiableStringSet(
49             LBConfigKeys.RESPONSE_TIMEOUT_IN_SECONDS_KEY,
50             LBConfigKeys.HTTPS_ROUTING_KEY,
51             LBConfigKeys.RELOAD_POLL_INTERVAL_IN_SECONDS_KEY,
52             LBConfigKeys.MONITORING_ENABLED_KEY,
53             LBConfigKeys.ROUTE_COOKIE_ENABLED_KEY
54         );
55
56     protected Set JavaDoc<String JavaDoc> getLegalOptionalCreateKeys() {
57         return(LEGAL_OPTIONAL_KEYS);
58     }
59
60     public ObjectName JavaDoc create(String JavaDoc name, Map JavaDoc<String JavaDoc,String JavaDoc> optional) {
61         final String JavaDoc[] required = {"name", name};
62         final Map JavaDoc<String JavaDoc,String JavaDoc> params = initParams(required, optional);
63         final ObjectName JavaDoc amxName = createNamedChild(name, params);
64         return amxName;
65     }
66
67     protected ObjectName JavaDoc createOldChildConfig(final AttributeList JavaDoc translatedAttrs) {
68         return getOldConfigProxies().getOldLbConfigs().createLbConfig(translatedAttrs);
69     }
70     
71     public void removeByName(String JavaDoc name) {
72         getOldConfigProxies().getOldLbConfigs().removeLbConfigByName(name);
73     }
74 }
75
76
Popular Tags