You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RpcProxy.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client.communication;
  5. import com.google.gwt.core.client.GWT;
  6. import com.vaadin.shared.communication.ServerRpc;
  7. import com.vaadin.terminal.gwt.client.ServerConnector;
  8. /**
  9. * Class for creating proxy instances for Client to Server RPC.
  10. *
  11. * @since 7.0
  12. */
  13. public class RpcProxy {
  14. private static RpcProxyCreator impl = GWT.create(RpcProxyCreator.class);
  15. /**
  16. * Create a proxy class for the given Rpc interface and assign it to the
  17. * given connector.
  18. *
  19. * @param rpcInterface
  20. * The rpc interface to construct a proxy for
  21. * @param connector
  22. * The connector this proxy is connected to
  23. * @return A proxy class used for calling Rpc methods.
  24. */
  25. public static <T extends ServerRpc> T create(Class<T> rpcInterface,
  26. ServerConnector connector) {
  27. return impl.create(rpcInterface, connector);
  28. }
  29. public interface RpcProxyCreator {
  30. <T extends ServerRpc> T create(Class<T> rpcInterface,
  31. ServerConnector connector);
  32. }
  33. }