neth 02/02/21 06:14:22 Modified: src/org/apache/jmeter/ejb/jndi/config MethodConfig.java Log: Added code to handle 'remote method' configuration. Revision Changes Path 1.2 +89 -11 jakarta-jmeter/src/org/apache/jmeter/ejb/jndi/config/MethodConfig.java Index: MethodConfig.java =================================================================== RCS file: /home/cvs/jakarta-jmeter/src/org/apache/jmeter/ejb/jndi/config/MethodConfig.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MethodConfig.java 19 Jan 2002 04:16:40 -0000 1.1 +++ MethodConfig.java 21 Feb 2002 14:14:22 -0000 1.2 @@ -56,6 +56,7 @@ import java.io.Serializable; import java.lang.reflect.Method; +import java.util.ArrayList; import org.apache.jmeter.config.AbstractConfigElement; import org.apache.jmeter.config.ConfigElement; @@ -82,6 +83,8 @@ "MethodConfig.method_home_list"; protected static final String METHOD_HOME_PARMS = "MethodConfig.method_home_parms"; + protected static final String METHOD_REMOTE_INTERFACE_LIST = + "MethodConfig.method_remote_name_list"; protected static final String METHOD_REMOTE_NAME = "MethodConfig.method_remote_name"; protected static final String METHOD_REMOTE_LIST = @@ -95,6 +98,8 @@ // class since sampling this class generates Method names // and parameters (through reflection) which will be used in the // MethodConfigGui + protected static final String METHOD_REMOTE_INTERFACE_TYPE = + "MethodConfig.method_remote_interface_type"; // Below are the states the MethodConfig can be in. Depending on the state // which MethodConfig is in, when 'Run' is executed, the sampler @@ -105,14 +110,25 @@ // with a Home method selected reflect on all parms of the method public static final int METHOD_INVOKE_HOME = 2; // with all parms of the selected method filled, invoke the method - public static final int METHOD_GET_REMOTE_NAMES = 3; + public static final int METHOD_SELECT_REMOTE_INTERFACE = 3; + public static final int METHOD_GET_REMOTE_NAMES = 4; // reflect on all the method names of the Remote interface - public static final int METHOD_GET_REMOTE_PARMS = 4; + public static final int METHOD_GET_REMOTE_PARMS = 5; // with a Remote method selected reflect on all parms of the method - public static final int METHOD_INVOKE_REMOTE = 5; + public static final int METHOD_INVOKE_REMOTE = 6; + public static final int METHOD_COMPLETE = 7; - protected Method method; + protected Method homeMethod; + protected Method remoteMethod; protected int state; + // This variable is always false until the 'Reflect' button on the + // ejb method config panel is clicked. This allows the JNDISampler + // to differentiate between sampling and relfection since it does both. + // When it does reflection, it will only run one reflection step at each time + // e.g. the first reflection will expose all methods of the home object + // returned by the lookup, the second the parms of the selected home object + // method etc. For sampling all the steps will be run. + protected boolean reflectionStatus = false; public MethodConfig() { @@ -159,13 +175,55 @@ return string; } - public void setMethodRemoteName(String string) + public void setMethodRemoteName(Object ref) { if(catClass.isDebugEnabled()) { - catClass.debug("setMethodRemoteName1 : method remote name - " + string); + catClass.debug("setMethodRemoteName1 : method remote name - " + ref); } - this.putProperty(METHOD_REMOTE_NAME, string); + this.putProperty(METHOD_REMOTE_NAME, ref); + } + + public Object getRemoteInterfaceType() + { + Object ref = this.getProperty(METHOD_REMOTE_INTERFACE_TYPE); + if(catClass.isDebugEnabled()) + { + catClass.debug("getRemoteInterfaceType1 : remote interface - " + + ref); + } + return ref; + } + + public void setRemoteInterfaceType(Object ref) + { + if(catClass.isDebugEnabled()) + { + catClass.debug("setRemoteInterfaceType1 : remote interface - " + + ref); + } + this.putProperty(METHOD_REMOTE_INTERFACE_TYPE, ref); + } + + public Object getRemoteInterfaceList() + { + Object ref = this.getProperty(METHOD_REMOTE_INTERFACE_LIST); + if(catClass.isDebugEnabled()) + { + catClass.debug("getRemoteInterfaceList1 : remote interface list - " + + ref); + } + return ref; + } + + public void setRemoteInterfaceList(Object ref) + { + if(catClass.isDebugEnabled()) + { + catClass.debug("setRemoteInterfaceList1 : remote interface list - " + + ref); + } + this.putProperty(METHOD_REMOTE_INTERFACE_LIST, ref); } public String[] getMethodHomeList() @@ -241,13 +299,33 @@ return (MethodConfigGui)this.getProperty(METHOD_CONFIG_GUI); } - public void setMethod(Method aMethod) + public void setHomeMethod(Method aMethod) + { + homeMethod = aMethod; + } + + public Method getHomeMethod() { - method = aMethod; + return homeMethod; + } + + public void setRemoteMethod(Method aMethod) + { + remoteMethod = aMethod; + } + + public Method getRemoteMethod() + { + return remoteMethod; + } + + public void setReflectionStatus(boolean status) + { + reflectionStatus = status; } - public Method getMethod() + public boolean getReflectionStatus() { - return method; + return reflectionStatus; } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>