1 23 24 package com.sun.enterprise.admin.server.core.mbean.config; 25 26 import javax.management.*; 28 29 import com.sun.enterprise.config.ConfigException; 31 import com.sun.enterprise.config.serverbeans.ServerTags; 32 import com.sun.enterprise.config.serverbeans.ServerXPathHelper; 33 import com.sun.enterprise.config.serverbeans.Profiler; 34 35 36 import com.sun.enterprise.admin.common.ObjectNames; 38 import com.sun.enterprise.admin.common.exception.MBeanConfigException; 39 import com.sun.enterprise.admin.common.constant.ConfigAttributeName; 40 41 47 public class ManagedProfiler extends ConfigMBeanBase implements ConfigAttributeName.Profiler 48 { 49 52 private static final String [][] MAPLIST = 53 { 54 {kName , ATTRIBUTE + ServerTags.NAME}, 55 {kClasspath , ATTRIBUTE + ServerTags.CLASSPATH}, 56 {kNativeLibraryPath , ATTRIBUTE + ServerTags.NATIVE_LIBRARY_PATH}, 57 {kEnabled , ATTRIBUTE + ServerTags.ENABLED}, 58 }; 59 62 private static final String [] ATTRIBUTES = 63 { 64 kName + ", String, R" , 65 kClasspath + ", String, RW" , 66 kNativeLibraryPath + ", String, RW" , 67 kEnabled + ", boolean, RW" , 68 }; 69 72 private static final String [] OPERATIONS = 73 { 74 "getJvmOptions(), INFO", 75 "setJvmOptions(String[] options), ACTION", 76 }; 77 78 81 public ManagedProfiler() throws MBeanConfigException 82 { 83 this.setDescriptions(MAPLIST, ATTRIBUTES, OPERATIONS); 84 } 85 86 90 public ManagedProfiler(String instanceName) throws MBeanConfigException 91 { 92 this(); initialize(ObjectNames.kProfiler, new String []{instanceName}); 94 } 95 98 public String [] getJvmOptions() throws ConfigException 99 { 100 Profiler profiler = (Profiler)getBaseConfigBean(); 101 return profiler.getJvmOptions(); 102 } 103 104 107 public void setJvmOptions(String [] options) throws ConfigException 108 { 109 Profiler profiler = (Profiler)getBaseConfigBean(); 110 profiler.setJvmOptions(options); 111 getConfigContext().flush(); 112 } 113 } 114 | Popular Tags |