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.OldJavaConfigMBean; 39 40 import com.sun.appserv.management.config.ProfilerConfigKeys; 41 42 import com.sun.appserv.management.util.misc.GSetUtil; 43 44 45 public final class ProfilerConfigFactory extends ConfigFactory 46 { 47 private final OldJavaConfigMBean mOldJavaConfigMBean; 48 49 public 50 ProfilerConfigFactory( 51 final ConfigFactoryCallback callbacks ) 52 { 53 super( callbacks ); 54 55 mOldJavaConfigMBean = 56 getOldConfigProxies().getOldJavaConfigMBean( getConfigName() ); 57 } 58 59 private final Set <String > LEGAL_OPTIONAL_KEYS = 60 GSetUtil.newUnmodifiableStringSet( 61 ProfilerConfigKeys.CLASSPATH_KEY, 62 ProfilerConfigKeys.NATIVE_LIBRARY_PATH_KEY, 63 ProfilerConfigKeys.ENABLED_KEY ); 64 65 protected Set <String > 66 getLegalOptionalCreateKeys() 67 { 68 return( LEGAL_OPTIONAL_KEYS ); 69 } 70 71 public ObjectName 72 create( final String name, final Map <String ,String > optional ) 73 { 74 final Map <String ,String > params = initParams( name, null, optional ); 75 76 final ObjectName amxName = createChild( params ); 77 78 return( amxName ); 79 } 80 81 public void 82 internalRemove( final ObjectName objectName ) 83 { 84 mOldJavaConfigMBean.removeProfiler(); 85 } 86 87 protected ObjectName 88 createOldChildConfig( final AttributeList attrs ) 89 { 90 return mOldJavaConfigMBean.createProfiler( attrs ); 91 } 92 } 93 94 | Popular Tags |