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.appserv.management.util.misc.MapUtil; 39 import com.sun.appserv.management.util.misc.GSetUtil; 40 41 import com.sun.enterprise.management.support.oldconfig.OldIIOPServiceMBean; 42 43 import com.sun.appserv.management.config.IIOPListenerConfigKeys; 44 45 46 public final class IIOPListenerConfigFactory extends ConfigFactory 47 { 48 private final OldIIOPServiceMBean mOldIIOPServiceMBean; 49 50 public 51 IIOPListenerConfigFactory( final ConfigFactoryCallback callbacks ) 52 { 53 super( callbacks ); 54 55 mOldIIOPServiceMBean = 56 callbacks.getOldConfigProxies().getOldIIOPServiceMBean( getConfigName() ); 57 } 58 59 private final Set <String > LEGAL_OPTIONAL_KEYS = GSetUtil.newUnmodifiableStringSet( 60 IIOPListenerConfigKeys.PORT_KEY, 61 IIOPListenerConfigKeys.SECURITY_ENABLED_KEY, 62 IIOPListenerConfigKeys.ENABLED_KEY ); 63 64 protected Set <String > 65 getLegalOptionalCreateKeys() 66 { 67 return( LEGAL_OPTIONAL_KEYS ); 68 } 69 70 71 72 public final static String ADDRESS_KEY = "Address"; 73 74 75 public ObjectName 76 create( String name, String address, Map <String ,String > optional ) 77 { 78 final String [] requiredParams = 79 { 80 ADDRESS_KEY, address, 81 }; 82 83 final Map <String ,String > params = initParams( name, requiredParams, optional ); 84 85 final ObjectName amxName = createNamedChild( name, params ); 86 87 return( amxName ); 88 } 89 90 protected void 91 removeByName( String name ) 92 { 93 mOldIIOPServiceMBean.removeIiopListenerById( name ); 94 } 95 96 protected Map <String ,String > 97 getParamNameOverrides() 98 { 99 return( MapUtil.newMap( CONFIG_NAME_KEY, "id" ) ); 100 } 101 102 protected ObjectName 103 createOldChildConfig( final AttributeList translatedAttrs ) 104 { 105 return mOldIIOPServiceMBean.createIiopListener( translatedAttrs ); 106 } 107 108 } 109 110 111 112 113 | Popular Tags |