1 23 24 29 30 31 package com.sun.enterprise.management.config; 32 33 import java.util.Map ; 34 import java.util.Set ; 35 import java.util.Collections ; 36 37 import javax.management.ObjectName ; 38 import javax.management.AttributeList ; 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 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 <String > 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 <String > 74 getLegalOptionalCreateKeys() 75 { 76 return( LEGAL_OPTIONAL_KEYS ); 77 } 78 79 80 public ObjectName 81 create( final Map <String ,String > optional ) 82 { 83 final Map <String ,String > params = initParams( optional ); 84 85 final ObjectName amxName = createChild( params ); 86 87 return( amxName ); 88 } 89 90 protected void 91 internalRemove( final ObjectName objectName ) 92 { 93 mOldAvailabilityService.removeEjbContainerAvailability(); 94 } 95 96 97 protected ObjectName 98 createOldChildConfig( final AttributeList attrs ) 99 { 100 final ObjectName oldObjectName = mOldAvailabilityService.createEjbContainerAvailability( attrs ); 101 102 return oldObjectName; 103 } 104 } 105 106 | Popular Tags |