void invokeRpcs(int num, int mode) throws Exception {
long start, stop;
int show=num/10;
Method measure_method=getClass().getMethod("measure", EMPTY_CLASS_ARRAY);
MethodCall measure_method_call=new MethodCall(measure_method, EMPTY_OBJECT_ARRAY);
if(show <=0) show=1;
start=System.currentTimeMillis();
switch(mode) {
case OLD:
System.out.println("-- invoking " + num + " methods using mode=OLD");
for(int i=1; i <= num; i++) {
disp.callRemoteMethods(null,
"measure",
EMPTY_OBJECT_ARRAY,
EMPTY_CLASS_ARRAY,
GroupRequest.GET_ALL, TIMEOUT);
if(i % show == 0)
System.out.println(i);
}
break;
case METHOD:
System.out.println("-- invoking " + num + " methods using mode=METHOD");
for(int i=1; i <= num; i++) {
disp.callRemoteMethods(null, measure_method_call, GroupRequest.GET_ALL, TIMEOUT);
if(i % show == 0)
System.out.println(i);
}
break;
case TYPES:
System.out.println("-- invoking " + num + " methods using mode=TYPES");
for(int i=1; i <= num; i++) {
disp.callRemoteMethods(null, "measure",
EMPTY_OBJECT_ARRAY,
EMPTY_CLASS_ARRAY,
GroupRequest.GET_ALL,
TIMEOUT);
if(i % show == 0)
System.out.println(i);
}
break;
case SIGNATURE:
System.out.println("-- invoking " + num + " methods using mode=SIGNATURE");
for(int i=1; i <= num; i++) {
disp.callRemoteMethods(null, "measure",
EMPTY_OBJECT_ARRAY,
EMPTY_STRING_ARRAY,
GroupRequest.GET_ALL,
TIMEOUT);
if(i % show == 0)
System.out.println(i);
}
break;
case ID:
System.out.println("-- invoking " + num + " methods using mode=ID");
measure_method_call=new MethodCall((short)0, null);
for(int i=1; i <= num; i++) {
disp.callRemoteMethods(null, measure_method_call, GroupRequest.GET_ALL, TIMEOUT);
if(i % show == 0)
System.out.println(i);
}