import com.vaadin.client.ResourceLoader.ResourceLoadEvent;
import com.vaadin.client.ResourceLoader.ResourceLoadListener;
import com.vaadin.client.communication.HasJavaScriptConnectorHelper;
+import com.vaadin.client.communication.JavaScriptMethodInvocation;
import com.vaadin.client.communication.JsonDecoder;
import com.vaadin.client.communication.JsonEncoder;
import com.vaadin.client.communication.RpcManager;
}
private boolean isJavascriptRpc(MethodInvocation invocation) {
- String connectorId = invocation.getConnectorId();
- ServerConnector connector = connectorMap.getConnector(connectorId);
- return connector instanceof HasJavaScriptConnectorHelper;
+ return invocation instanceof JavaScriptMethodInvocation;
}
private boolean isLegacyVariableChange(MethodInvocation invocation) {
import com.google.gwt.core.client.JsArray;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.user.client.Element;
+import com.vaadin.client.communication.JavaScriptMethodInvocation;
import com.vaadin.client.communication.StateChangeEvent;
import com.vaadin.client.communication.StateChangeEvent.StateChangeHandler;
import com.vaadin.shared.JavaScriptConnectorState;
parameters[i] = argumentsArray.get(i);
}
connector.getConnection().addMethodInvocationToQueue(
- new MethodInvocation(connector.getConnectorId(), iface, method,
- parameters), false, false);
+ new JavaScriptMethodInvocation(connector.getConnectorId(),
+ iface, method, parameters), false, false);
}
private String findWildcardInterface(String method) {
}
private void fireCallback(String name, JsArray<JavaScriptObject> arguments) {
- MethodInvocation invocation = new MethodInvocation(
+ MethodInvocation invocation = new JavaScriptMethodInvocation(
connector.getConnectorId(),
"com.vaadin.ui.JavaScript$JavaScriptCallbackRpc", "call",
new Object[] { name, new JSONArray(arguments) });
--- /dev/null
+/*
+ * Copyright 2012 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.client.communication;
+
+import com.vaadin.shared.communication.MethodInvocation;
+
+/**
+ * A {@link MethodInvocation} that originates from JavaScript. This means that
+ * there might not be any type information available on the client.
+ *
+ * @author Vaadin Ltd
+ * @since 7.0.0
+ */
+public class JavaScriptMethodInvocation extends MethodInvocation {
+
+ public JavaScriptMethodInvocation(String connectorId, String interfaceName,
+ String methodName, Object[] parameters) {
+ super(connectorId, interfaceName, methodName, parameters);
+ }
+}
import com.google.gwt.json.client.JSONArray;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.communication.StateChangeEvent;
+import com.vaadin.client.communication.JavaScriptMethodInvocation;
import com.vaadin.client.extensions.AbstractExtensionConnector;
-import com.vaadin.shared.communication.MethodInvocation;
import com.vaadin.shared.extension.javascriptmanager.ExecuteJavaScriptRpc;
import com.vaadin.shared.extension.javascriptmanager.JavaScriptManagerState;
import com.vaadin.shared.ui.Connect;
* because of the JSONArray parameter
*/
getConnection().addMethodInvocationToQueue(
- new MethodInvocation(getConnectorId(),
+ new JavaScriptMethodInvocation(getConnectorId(),
"com.vaadin.ui.JavaScript$JavaScriptCallbackRpc",
"call", parameters), false, false);
}