invocationJson.put(invocation.getInterfaceName());
invocationJson.put(invocation.getMethodName());
JSONArray paramJson = new JSONArray();
- for (int i = 0; i < invocation.getParameters().length; ++i) {
+ for (int i = 0; i < invocation.getParameterTypes().length; ++i) {
paramJson.put(JsonCodec.encode(
- invocation.getParameters()[i], application));
+ invocation.getParameters()[i],
+ invocation.getParameterTypes()[i], application));
}
invocationJson.put(paramJson);
rpcCalls.put(invocationJson);
package com.vaadin.terminal.gwt.server;
import java.io.Serializable;
+import java.lang.reflect.Method;
/**
* Internal class for keeping track of pending server to client method
private final String interfaceName;
private final String methodName;
private final Object[] parameters;
+ private Class<?>[] parameterTypes;
- // used for sorting calls between different Paintables in the same Root
+ // used for sorting calls between different connectors in the same Root
private final long sequenceNumber;
// TODO may cause problems when clustering etc.
private static long counter = 0;
public ClientMethodInvocation(ClientConnector connector,
- String interfaceName, String methodName, Object[] parameters) {
+ String interfaceName, Method method, Object[] parameters) {
this.connector = connector;
this.interfaceName = interfaceName;
- this.methodName = methodName;
+ methodName = method.getName();
+ parameterTypes = method.getParameterTypes();
this.parameters = (null != parameters) ? parameters : new Object[0];
sequenceNumber = ++counter;
}
+ public Class<?>[] getParameterTypes() {
+ return parameterTypes;
+ }
+
public ClientConnector getConnector() {
return connector;
}
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
- addMethodInvocationToQueue(rpcInterfaceName, method.getName(), args);
+ addMethodInvocationToQueue(rpcInterfaceName, method, args);
// TODO no need to do full repaint if only RPC calls
requestRepaint();
return null;
* @since 7.0
*/
protected void addMethodInvocationToQueue(String interfaceName,
- String methodName, Object[] parameters) {
+ Method method, Object[] parameters) {
// add to queue
pendingInvocations.add(new ClientMethodInvocation(this, interfaceName,
- methodName, parameters));
+ method, parameters));
}
/**