PageRenderTime 54ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/gwtrpccommlayer/src/main/java/com/googlecode/gwtrpccommlayer/client/GwtRpcService.java

https://code.google.com/p/gwtrpccommlayer/
Java | 43 lines | 18 code | 8 blank | 17 comment | 0 complexity | 91a3b66a1202bd256418bf90906d2f29 MD5 | raw file
  1. package com.googlecode.gwtrpccommlayer.client;
  2. import com.google.inject.Guice;
  3. import org.apache.http.cookie.Cookie;
  4. import java.net.URL;
  5. import java.util.Collection;
  6. /**
  7. *
  8. * Meant to accept Service Interface Classes and return an implementation.
  9. *
  10. * Created by IntelliJ IDEA.
  11. * User: dan
  12. * Date: 10/30/10
  13. * Time: 2:52 PM
  14. */
  15. public interface GwtRpcService {
  16. public interface Factory {
  17. GwtRpcService newInstance();
  18. }
  19. public static final Factory FACTORY = new Factory() {
  20. @Override
  21. public GwtRpcService newInstance() {
  22. return Guice.createInjector(new Module()).getInstance(GwtRpcService.class);
  23. }
  24. };
  25. /**
  26. * This weakly specified generic T kinda sucks because the "async" GWT interface is not identified by anything.
  27. *
  28. * @param url
  29. * @param serviceClass
  30. * @param <T>
  31. * @return
  32. */
  33. <T> T create(URL url, Class<T> serviceClass);
  34. <T> T create(URL url, Class<T> serviceClass, Collection<Cookie> cookies);
  35. }