Centralizing RPC calls for better handling and usability and reliability

In this section, we introduce a centralized Remote Procedure Call class that brings three major improvements to our application:

  • The capability to show a loading indicator when the application is busy waiting for the backend
  • The ability to retry failed calls automatically
  • A facility to centralize the handling of exceptions sent by the backend

Introducing an encompassing RPC class

To achieve our goals, we need to centralize all the Remote Procedure Calls into a higher-level class named RPCCall:

package com.metadot.book.connectr.client.helper; // import omitted for increased readabiity public abstract class RPCCall<T> implements AsyncCallback<T> { protected abstract void callService(AsyncCallback<T> ...

Get Google App Engine Java and GWT Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.