@SuppressWarnings({"unchecked"}) protected <R> void execute(RestAction<R> action) { DispatchRequest dispatchRequest = dispatcher.execute(action, (AsyncCallback<R>) callback); if (delegatingDispatchRequest != null) { delegatingDispatchRequest.setDelegate(dispatchRequest); } }
@SuppressWarnings("unchecked") protected void delegateExecute(RpcInterceptor<A, R> interceptor) { dispatchRequest.setDelegate(interceptor.execute(action, callback, this)); }
private void updateDispatchRequest() { if (dispatchRequest != null) { delegateMocking.getDelegatingDispatchRequest().setDelegate(dispatchRequest); } } }
private void delegateExecute(ClientActionHandler<A, R> clientActionHandler) { dispatchRequest.setDelegate(clientActionHandler.execute(action, callback, this)); } }
@SuppressWarnings("unchecked") protected void delegateExecute(Interceptor interceptor) { dispatchRequest.setDelegate(interceptor.execute(action, callback, this)); }
@Override public void onSuccess(ClientActionHandler<?, ?> clientActionHandler) { if (clientActionHandler.getActionType() != action.getClass()) { dispatchRequest.cancel(); callback.onFailure(new ClientActionHandlerMismatchException( (Class<? extends Action<?>>) action.getClass(), clientActionHandler.getActionType())); return; } if (dispatchRequest.isPending()) { dispatchRequest.setDelegate(((ClientActionHandler<A, R>) clientActionHandler).undo( action, result, callback, new UndoCommand<A, R>() { @Override public DispatchRequest undo(A action, R result, AsyncCallback<Void> callback) { if (dispatchRequest.isPending()) { return doUndo(securityCookie, action, result, callback); } else { return null; } } })); } }
@Override public void onSuccess(ClientActionHandler<?, ?> clientActionHandler) { if (clientActionHandler.getActionType() != action.getClass()) { dispatchRequest.cancel(); callback.onFailure(new ClientActionHandlerMismatchException( (Class<? extends Action<?>>) action.getClass(), clientActionHandler.getActionType())); return; } if (dispatchRequest.isPending()) { dispatchRequest.setDelegate(((ClientActionHandler<A, R>) clientActionHandler).execute( action, callback, new ExecuteCommand<A, R>() { @Override public DispatchRequest execute(A action, AsyncCallback<R> resultCallback) { if (dispatchRequest.isPending()) { return doExecute(securityCookie, action, resultCallback); } else { return null; } } })); } }