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.util.misc.GSetUtil; 44 import com.sun.appserv.management.config.WebContainerAvailabilityConfigKeys; 45 46 47 49 public final class WebContainerAvailabilityConfigFactory extends ConfigFactory 50 { 51 private final OldAvailabilityServiceMBean mOldAvailabilityService; 52 53 public 54 WebContainerAvailabilityConfigFactory( 55 final ConfigFactoryCallback callbacks) 56 { 57 super( callbacks ); 58 59 mOldAvailabilityService = 60 getOldConfigProxies().getOldAvailabilityServiceMBean( getConfigName() ); 61 } 62 63 private final Set <String > LEGAL_OPTIONAL_KEYS = 64 GSetUtil.newUnmodifiableStringSet( 65 WebContainerAvailabilityConfigKeys.WEB_CONTAINER_AVAILABILITY_ENABLED_KEY, 66 WebContainerAvailabilityConfigKeys.PERSISTENCE_TYPE_KEY, 67 WebContainerAvailabilityConfigKeys.PERSISTENCE_FREQUENCY_KEY, 68 WebContainerAvailabilityConfigKeys.PERSISTENCE_SCOPE_KEY, 69 WebContainerAvailabilityConfigKeys.PERSISTENCE_STORE_HEALTH_CHECK_ENABLED_KEY , 70 WebContainerAvailabilityConfigKeys.SSO_FAILOVER_ENABLED_KEY, 71 WebContainerAvailabilityConfigKeys.HTTP_SESSION_STORE_POOL_NAME_KEY 72 ); 73 74 protected Set <String > 75 getLegalOptionalCreateKeys() 76 { 77 return( LEGAL_OPTIONAL_KEYS ); 78 } 79 80 81 82 84 public ObjectName 85 create( final Map <String ,String > optional ) 86 { 87 final Map <String ,String > params = initParams( optional ); 88 89 final ObjectName amxName = createChild( optional ); 90 91 return( amxName ); 92 } 93 94 protected void 95 internalRemove( final ObjectName objectName ) 96 { 97 mOldAvailabilityService.removeWebContainerAvailability(); 98 } 99 100 101 protected ObjectName 102 createOldChildConfig( final AttributeList attrs ) 103 { 104 final ObjectName oldObjectName = mOldAvailabilityService.createWebContainerAvailability( attrs ); 105 106 return oldObjectName; 107 } 108 } 109 110 | Popular Tags |