Example usage for com.vaadin.shared.communication LegacyChangeVariablesInvocation isLegacyVariableChange

List of usage examples for com.vaadin.shared.communication LegacyChangeVariablesInvocation isLegacyVariableChange

Introduction

In this page you can find the example usage for com.vaadin.shared.communication LegacyChangeVariablesInvocation isLegacyVariableChange.

Prototype

public static boolean isLegacyVariableChange(String interfaceName, String methodName) 

Source Link

Usage

From source file:org.semanticsoft.vaaclipse.app.servlet.VaaclipseServerRpcHandler.java

License:Open Source License

private MethodInvocation parseInvocation(JSONArray invocationJson, MethodInvocation previousInvocation,
        ConnectorTracker connectorTracker, long lastSyncIdSeenByClient) throws JSONException {
    String connectorId = invocationJson.getString(0);
    String interfaceName = invocationJson.getString(1);
    String methodName = invocationJson.getString(2);

    if (connectorTracker.getConnector(connectorId) == null
            && !connectorId.equals(ApplicationConstants.DRAG_AND_DROP_CONNECTOR_ID)) {

        if (!connectorTracker.connectorWasPresentAsRequestWasSent(connectorId, lastSyncIdSeenByClient)) {
            getLogger().log(Level.WARNING,
                    "RPC call to " + interfaceName + "." + methodName + " received for connector " + connectorId
                            + " but no such connector could be found. Resynchronizing client.");
            // This is likely an out of sync issue (client tries to update a
            // connector which is not present). Force resync.
            connectorTracker.markAllConnectorsDirty();
        }/*from ww  w. java2s  .  c  o m*/
        return null;
    }

    JSONArray parametersJson = invocationJson.getJSONArray(3);

    if (LegacyChangeVariablesInvocation.isLegacyVariableChange(interfaceName, methodName)) {
        if (!(previousInvocation instanceof LegacyChangeVariablesInvocation)) {
            previousInvocation = null;
        }

        return parseLegacyChangeVariablesInvocation(connectorId, interfaceName, methodName,
                (LegacyChangeVariablesInvocation) previousInvocation, parametersJson, connectorTracker);
    } else {
        return parseServerRpcInvocation(connectorId, interfaceName, methodName, parametersJson,
                connectorTracker);
    }

}