KickJava   Java API By Example, From Geeks To Geeks.

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


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/EJBContainerAvailabilityConfigFactory.java,v 1.5 2006/03/09 20:30:38 llc Exp $
26  * $Revision: 1.5 $
27  * $Date: 2006/03/09 20:30:38 $
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.appserv.management.base.XTypes;
41 import com.sun.enterprise.management.support.oldconfig.OldAvailabilityServiceMBean;
42
43 import com.sun.appserv.management.config.EJBContainerAvailabilityConfigKeys;
44
45 import com.sun.appserv.management.util.misc.GSetUtil;
46
47 /**
48  */

49 public final class EJBContainerAvailabilityConfigFactory extends ConfigFactory
50 {
51     private final OldAvailabilityServiceMBean mOldAvailabilityService;
52     
53         public
54     EJBContainerAvailabilityConfigFactory(
55         final ConfigFactoryCallback callbacks,
56         OldAvailabilityServiceMBean old )
57     {
58         super( callbacks );
59         
60         mOldAvailabilityService =
61             getOldConfigProxies().getOldAvailabilityServiceMBean( getConfigName() );
62     }
63     
64     private final Set JavaDoc<String JavaDoc> LEGAL_OPTIONAL_KEYS =
65         GSetUtil.newUnmodifiableStringSet(
66         EJBContainerAvailabilityConfigKeys.EJB_CONTAINER_AVAILABILITY_ENABLED_KEY,
67         EJBContainerAvailabilityConfigKeys.SFSB_HA_PERSISTENCE_TYPE_KEY,
68         EJBContainerAvailabilityConfigKeys.SFSB_PERSISTENCE_TYPE_KEY,
69         EJBContainerAvailabilityConfigKeys.SFSB_CHECKPOINT_ENABLED_KEY,
70         EJBContainerAvailabilityConfigKeys.SFSB_QUICK_CHECKPOINT_ENABLED_KEY,
71         EJBContainerAvailabilityConfigKeys.SFSB_STORE_POOL_NAME_KEY);
72     
73         protected Set JavaDoc<String JavaDoc>
74     getLegalOptionalCreateKeys()
75     {
76         return( LEGAL_OPTIONAL_KEYS );
77     }
78
79
80         public ObjectName JavaDoc
81     create( final Map JavaDoc<String JavaDoc,String JavaDoc> optional )
82     {
83         final Map JavaDoc<String JavaDoc,String JavaDoc> params = initParams( optional );
84
85         final ObjectName JavaDoc amxName = createChild( params );
86         
87         return( amxName );
88     }
89     
90         protected void
91     internalRemove( final ObjectName JavaDoc objectName )
92     {
93         mOldAvailabilityService.removeEjbContainerAvailability();
94     }
95     
96
97         protected ObjectName JavaDoc
98     createOldChildConfig( final AttributeList JavaDoc attrs )
99     {
100         final ObjectName JavaDoc oldObjectName = mOldAvailabilityService.createEjbContainerAvailability( attrs );
101
102         return oldObjectName;
103     }
104 }
105
106
Popular Tags