1 18 19 package org.apache.jmeter.ejb.jndi.config; 20 21 import java.io.Serializable ; 22 import java.lang.reflect.Method ; 23 import java.util.ArrayList ; 24 25 import org.apache.jmeter.config.AbstractConfigElement; 26 import org.apache.jmeter.config.ConfigElement; 27 import org.apache.jmeter.ejb.jndi.config.gui.MethodConfigGui; 28 import org.apache.jmeter.util.JMeterUtils; 29 import org.apache.log4j.Category; 30 31 38 public class MethodConfig extends AbstractConfigElement implements Serializable 39 { 40 private static Category catClass = Category.getInstance( 41 MethodConfig.class.getName()); 42 43 protected static final String METHOD_HOME_NAME = 44 "MethodConfig.method_home_name"; 45 protected static final String METHOD_HOME_LIST = 46 "MethodConfig.method_home_list"; 47 protected static final String METHOD_HOME_PARMS = 48 "MethodConfig.method_home_parms"; 49 protected static final String METHOD_REMOTE_INTERFACE_LIST = 50 "MethodConfig.method_remote_name_list"; 51 protected static final String METHOD_REMOTE_NAME = 52 "MethodConfig.method_remote_name"; 53 protected static final String METHOD_REMOTE_LIST = 54 "MethodConfig.method_remote_list"; 55 protected static final String METHOD_REMOTE_PARMS = 56 "MethodConfig.method_remote_parms"; 57 protected static final String METHOD_CONFIG_GUI = 58 "MethodConfig.method_config_gui"; 59 protected static final String METHOD_REMOTE_INTERFACE_TYPE = 65 "MethodConfig.method_remote_interface_type"; 66 67 public static final int METHOD_GET_HOME_NAMES = 0; 71 public static final int METHOD_GET_HOME_PARMS = 1; 73 public static final int METHOD_INVOKE_HOME = 2; 75 public static final int METHOD_SELECT_REMOTE_INTERFACE = 3; 77 public static final int METHOD_GET_REMOTE_NAMES = 4; 78 public static final int METHOD_GET_REMOTE_PARMS = 5; 80 public static final int METHOD_INVOKE_REMOTE = 6; 82 public static final int METHOD_COMPLETE = 7; 83 84 protected Method homeMethod; 85 protected Method remoteMethod; 86 protected int state; 87 protected boolean reflectionStatus = false; 95 96 public MethodConfig() 97 { 98 } 99 100 public Class getGuiClass() 101 { 102 return org.apache.jmeter.ejb.jndi.config.gui.MethodConfigGui.class; 103 } 104 105 public Object clone() 106 { 107 MethodConfig newConfig = new MethodConfig(); 108 configureClone(newConfig); 109 return newConfig; 110 } 111 112 public String getMethodHomeName() 113 { 114 String string = (String )this.getProperty(METHOD_HOME_NAME); 115 if(catClass.isDebugEnabled()) 116 { 117 catClass.debug("getMethodHomeName1 : method home name - " + string); 118 } 119 return string; 120 } 121 122 public void setMethodHomeName(String string) 123 { 124 if(catClass.isDebugEnabled()) 125 { 126 catClass.debug("setMethodHomeName1 : method home name - " + string); 127 } 128 this.putProperty(METHOD_HOME_NAME, string); 129 } 130 131 public String getMethodRemoteName() 132 { 133 String string = (String )this.getProperty(METHOD_REMOTE_NAME); 134 if(catClass.isDebugEnabled()) 135 { 136 catClass.debug("getMethodRemoteName1 : method remote name - " + string); 137 } 138 return string; 139 } 140 141 public void setMethodRemoteName(Object ref) 142 { 143 if(catClass.isDebugEnabled()) 144 { 145 catClass.debug("setMethodRemoteName1 : method remote name - " + ref); 146 } 147 this.putProperty(METHOD_REMOTE_NAME, ref); 148 } 149 150 public Object getRemoteInterfaceType() 151 { 152 Object ref = this.getProperty(METHOD_REMOTE_INTERFACE_TYPE); 153 if(catClass.isDebugEnabled()) 154 { 155 catClass.debug("getRemoteInterfaceType1 : remote interface - " + 156 ref); 157 } 158 return ref; 159 } 160 161 public void setRemoteInterfaceType(Object ref) 162 { 163 if(catClass.isDebugEnabled()) 164 { 165 catClass.debug("setRemoteInterfaceType1 : remote interface - " + 166 ref); 167 } 168 this.putProperty(METHOD_REMOTE_INTERFACE_TYPE, ref); 169 } 170 171 public Object getRemoteInterfaceList() 172 { 173 Object ref = this.getProperty(METHOD_REMOTE_INTERFACE_LIST); 174 if(catClass.isDebugEnabled()) 175 { 176 catClass.debug("getRemoteInterfaceList1 : remote interface list - " + 177 ref); 178 } 179 return ref; 180 } 181 182 public void setRemoteInterfaceList(Object ref) 183 { 184 if(catClass.isDebugEnabled()) 185 { 186 catClass.debug("setRemoteInterfaceList1 : remote interface list - " + 187 ref); 188 } 189 this.putProperty(METHOD_REMOTE_INTERFACE_LIST, ref); 190 } 191 192 public String [] getMethodHomeList() 193 { 194 String [] strings = (String [])this.getProperty(METHOD_HOME_LIST); 195 return strings; 196 } 197 198 public void setMethodHomeList(String [] list) 199 { 200 this.putProperty(METHOD_HOME_LIST, list); 201 } 202 203 public String [] getMethodRemoteList() 204 { 205 String [] strings = (String [])this.getProperty(METHOD_REMOTE_LIST); 206 return strings; 207 } 208 209 public void setMethodRemoteList(String [] list) 210 { 211 this.putProperty(METHOD_REMOTE_LIST, list); 212 } 213 214 public Class [] getMethodHomeParms() 215 { 216 Class [] classes= (Class [])this.getProperty(METHOD_HOME_PARMS); 217 return classes; 218 } 219 220 public void setMethodHomeParms(Class [] list) 221 { 222 this.putProperty(METHOD_HOME_PARMS, list); 223 } 224 225 public Class [] getMethodRemoteParms() 226 { 227 Class [] classes= (Class [])this.getProperty(METHOD_REMOTE_PARMS); 228 return classes; 229 } 230 231 public void setMethodRemoteParms(Class [] list) 232 { 233 this.putProperty(METHOD_REMOTE_PARMS, list); 234 } 235 236 public int getState() 237 { 238 return state; 239 } 240 241 public void setState(int current) 242 { 243 state = current; 244 } 245 246 public String getClassLabel() 247 { 248 return JMeterUtils.getResString("jndi_method_title"); 249 } 250 251 public void addConfigElement(ConfigElement config) 252 { 253 } 254 255 public void setGui(MethodConfigGui gui) 256 { 257 this.putProperty(METHOD_CONFIG_GUI, gui); 258 } 259 260 public MethodConfigGui getGui() 261 { 262 return (MethodConfigGui)this.getProperty(METHOD_CONFIG_GUI); 263 } 264 265 public void setHomeMethod(Method aMethod) 266 { 267 homeMethod = aMethod; 268 } 269 270 public Method getHomeMethod() 271 { 272 return homeMethod; 273 } 274 275 public void setRemoteMethod(Method aMethod) 276 { 277 remoteMethod = aMethod; 278 } 279 280 public Method getRemoteMethod() 281 { 282 return remoteMethod; 283 } 284 285 public void setReflectionStatus(boolean status) 286 { 287 reflectionStatus = status; 288 } 289 290 public boolean getReflectionStatus() 291 { 292 return reflectionStatus; 293 } 294 } 295 | Popular Tags |