- System.out.println(Arrays.toString(paramObj2));
- rmiCall.remoteCall(objectId, methodId2, retType2, null, paramCls2, paramObj2);
- }
+ //System.out.println(Arrays.toString(paramObj2));
+ Object retObj = rmiCall.remoteCall(objectId, methodId2, retType2, null, paramCls2, paramObj2);
+ // RETURN STRUCT
+ // Get the length of the struct first
+ int structsize1 = (int) retObj;
+ // Construct the struct
+ Class<?>[] retCls = new Class<?>[3*structsize1];
+ Class<?>[] retClsVal = new Class<?>[3*structsize1];
+ pos = 0;
+ for(int i=0; i < structsize1; i++) {
+ retCls[pos] = String.class;
+ retClsVal[pos++] = null;
+ retCls[pos] = float.class;
+ retClsVal[pos++] = null;
+ retCls[pos] = int.class;
+ retClsVal[pos++] = null;
+ }
+ Object[] retObj2 = rmiCall.getStructObjects(retCls,
+ retClsVal);
+ StructJ[] dataRet = new StructJ[structsize1];
+ for (int i=0; i < structsize1; i++) {
+ dataRet[i] = new StructJ();
+ }
+ pos = 0;
+ for(int i=0; i < structsize1; i++) {
+ dataRet[i].name = (String) retObj2[pos++];
+ dataRet[i].value = (float) retObj2[pos++];
+ dataRet[i].year = (int) retObj2[pos++];
+ }