1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Set ; 26 import java.util.Map ; 27 import java.util.Properties ; 28 29 import javax.management.ObjectName ; 30 import javax.management.AttributeList ; 31 32 import com.sun.appserv.management.base.XTypes; 33 import com.sun.appserv.management.config.AMXConfig; 34 import com.sun.appserv.management.config.ResourceAdapterConfigKeys; 35 import com.sun.enterprise.management.support.Delegate; 36 import com.sun.appserv.management.util.misc.MapUtil; 37 import com.sun.appserv.management.util.misc.GSetUtil; 38 39 40 41 42 43 46 47 public final class ResourceAdapterConfigFactory extends ResourceFactoryImplBase 48 { 50 public 51 ResourceAdapterConfigFactory( final ConfigFactoryCallback callbacks ) 52 { 53 super( callbacks ); 54 } 55 56 private final Set <String > LEGAL_OPTIONAL_KEYS = 57 GSetUtil.newUnmodifiableStringSet( 58 ResourceAdapterConfigKeys.THREAD_POOL_IDS_KEY 59 ); 60 61 protected Set <String > 62 getLegalOptionalCreateKeys() 63 { 64 return( LEGAL_OPTIONAL_KEYS ); 65 } 66 67 68 public static final String RES_ADAPTOR_NAME_KEY = "ResourceAdapterName"; 69 70 protected Map <String ,String > 71 getParamNameOverrides() 72 { 73 return( MapUtil.newMap( ResourceAdapterConfigKeys.THREAD_POOL_IDS_KEY, "thread-pool-ids" ) ); 74 } 75 76 77 80 protected ObjectName 81 createOldChildConfig( 82 final AttributeList translatedAttrs, 83 final Properties properties ) 84 { 85 final ObjectName objectName = 86 getOldResourcesMBean().createResourceAdapterConfig( 87 translatedAttrs, properties, null ); 88 89 return( objectName ); 90 } 91 92 98 public ObjectName 99 create( String resourceAdapterName, Map <String ,String > optional ) 100 { 101 final String [] requiredParams = new String [] { 102 RES_ADAPTOR_NAME_KEY, resourceAdapterName, 103 }; 104 105 final Map <String ,String > params = initParams( requiredParams, optional ); 106 107 final ObjectName amxName = createNamedChild( resourceAdapterName, params ); 108 109 return( amxName ); 110 } 111 112 113 protected void 114 removeByName( final String name ) 115 { 116 getOldResourcesMBean().deleteResourceAdapterConfig( name, null); 117 } 118 119 } 120 121 | Popular Tags |