1 23 24 29 package com.sun.enterprise.management.config; 30 31 import java.util.Map ; 32 import java.util.Set ; 33 import java.util.Collections ; 34 35 import javax.management.ObjectName ; 36 import javax.management.AttributeList ; 37 38 import com.sun.enterprise.management.support.oldconfig.OldHTTPServiceMBean; 39 40 import com.sun.appserv.management.util.misc.GSetUtil; 41 import com.sun.appserv.management.config.KeepAliveConfigKeys; 42 43 44 final class KeepAliveConfigFactory extends ConfigFactory 45 { 46 private final OldHTTPServiceMBean mOldHTTPServiceMBean; 47 48 public 49 KeepAliveConfigFactory( final ConfigFactoryCallback callbacks ) 50 { 51 super( callbacks ); 52 53 mOldHTTPServiceMBean = 54 getOldConfigProxies().getOldHTTPServiceMBean( getConfigName() ); 55 } 56 57 58 private final Set <String > LEGAL_OPTIONAL_KEYS = 59 GSetUtil.newUnmodifiableStringSet( 60 KeepAliveConfigKeys.THREAD_COUNT_KEY, 61 KeepAliveConfigKeys.MAX_CONNECTIONS_KEY, 62 KeepAliveConfigKeys.TIMEOUT_IN_SECONDS_KEY ); 63 64 protected Set <String > 65 getLegalOptionalCreateKeys() 66 { 67 return( LEGAL_OPTIONAL_KEYS ); 68 } 69 70 71 public ObjectName 72 create( final Map <String ,String > optional ) 73 { 74 final Map <String ,String > params = initParams( optional ); 75 76 final ObjectName amxName = createChild( params ); 77 78 return( amxName ); 79 } 80 81 protected void 82 internalRemove( final ObjectName objectName ) 83 { 84 mOldHTTPServiceMBean.removeKeepAlive(); 85 } 86 87 protected ObjectName 88 createOldChildConfig( AttributeList attrs ) 89 { 90 return mOldHTTPServiceMBean.createKeepAlive( attrs ); 91 } 92 } 93 94 95 96 97 | Popular Tags |