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.OldJMSServiceMBean; 39 40 import com.sun.appserv.management.config.JMSHostConfigKeys; 41 42 import com.sun.appserv.management.util.misc.GSetUtil; 43 44 46 public final class JMSHostConfigFactory 47 extends ConfigFactory 48 { 49 private final OldJMSServiceMBean mOldJMSServiceMBean; 50 51 public 52 JMSHostConfigFactory( 53 final ConfigFactoryCallback callbacks, 54 final OldJMSServiceMBean old ) 55 { 56 super( callbacks ); 57 58 mOldJMSServiceMBean = old; 59 } 60 61 private final Set <String > LEGAL_OPTIONAL_KEYS = 62 GSetUtil.newUnmodifiableStringSet( 63 JMSHostConfigKeys.HOST_KEY, 64 JMSHostConfigKeys.PORT_KEY, 65 JMSHostConfigKeys.ADMIN_USER_NAME_KEY, 66 JMSHostConfigKeys.ADMIN_PASSWORD_KEY ); 67 68 protected Set <String > 69 getLegalOptionalCreateKeys() 70 { 71 return( LEGAL_OPTIONAL_KEYS ); 72 } 73 74 public ObjectName 75 create( String name, Map <String ,String > optional ) 76 { 77 final Map <String ,String > params = initParams( name, null, optional ); 78 final ObjectName amxName = createNamedChild( name, params ); 79 return amxName; 80 } 81 82 protected void 83 removeByName( String name ) 84 { 85 mOldJMSServiceMBean.removeJmsHostByName(name); 86 } 87 88 89 protected ObjectName 90 createOldChildConfig( final AttributeList translatedAttrs ) 91 { 92 return mOldJMSServiceMBean.createJmsHost( translatedAttrs ); 93 } 94 } 95 96 97 98 99 | Popular Tags |