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