PageRenderTime 33ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/gwtp-extension/src/main/java/com/googlecode/gwtrpccommlayer/gwtp/server/DispatchingPOJOServlet.java

https://code.google.com/p/gwtrpccommlayer/
Java | 46 lines | 32 code | 8 blank | 6 comment | 0 complexity | 49354336e8d932c3099cf4b89ffce27b MD5 | raw file
  1. package com.googlecode.gwtrpccommlayer.gwtp.server;
  2. import com.google.inject.Inject;
  3. import com.googlecode.gwtrpccommlayer.server.GwtRpcCommLayerServlet;
  4. import com.gwtplatform.dispatch.client.DispatchService;
  5. import com.gwtplatform.dispatch.server.Dispatch;
  6. import com.gwtplatform.dispatch.shared.Action;
  7. import com.gwtplatform.dispatch.shared.ActionException;
  8. import com.gwtplatform.dispatch.shared.Result;
  9. import com.gwtplatform.dispatch.shared.ServiceException;
  10. import javax.inject.Singleton;
  11. /**
  12. * Created by IntelliJ IDEA.
  13. * User: dan
  14. * Date: 10/30/10
  15. * Time: 3:06 PM
  16. */
  17. @Singleton
  18. public class DispatchingPOJOServlet
  19. extends GwtRpcCommLayerServlet
  20. implements DispatchService{
  21. private static final long serialVersionUID = 8270773441785078583L;
  22. private Dispatch dispatch;
  23. @Inject
  24. public DispatchingPOJOServlet(Dispatch dispatch) {
  25. super();
  26. this.dispatch = dispatch;
  27. }
  28. @Override
  29. public Result execute(String cookieSentByRPC, Action<?> action)
  30. throws ActionException, ServiceException {
  31. return dispatch.execute(action);
  32. }
  33. @Override
  34. public void undo(String cookieSentByRPC, Action<Result> action,
  35. Result result) throws ActionException, ServiceException {
  36. dispatch.undo(action, result);
  37. }
  38. }