PageRenderTime 14ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms 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
 1package com.googlecode.gwtrpccommlayer.gwtp.server;
 2
 3import com.google.inject.Inject;
 4import com.googlecode.gwtrpccommlayer.server.GwtRpcCommLayerServlet;
 5import com.gwtplatform.dispatch.client.DispatchService;
 6import com.gwtplatform.dispatch.server.Dispatch;
 7import com.gwtplatform.dispatch.shared.Action;
 8import com.gwtplatform.dispatch.shared.ActionException;
 9import com.gwtplatform.dispatch.shared.Result;
10import com.gwtplatform.dispatch.shared.ServiceException;
11
12import javax.inject.Singleton;
13
14/**
15 * Created by IntelliJ IDEA.
16 * User: dan
17 * Date: 10/30/10
18 * Time: 3:06 PM
19 */
20@Singleton
21public class DispatchingPOJOServlet
22        extends GwtRpcCommLayerServlet
23        implements DispatchService{
24    private static final long serialVersionUID = 8270773441785078583L;
25
26    private Dispatch dispatch;
27
28    @Inject
29    public DispatchingPOJOServlet(Dispatch dispatch) {
30        super();
31        this.dispatch = dispatch;
32    }
33
34    @Override
35    public Result execute(String cookieSentByRPC, Action<?> action)
36            throws ActionException, ServiceException {
37        return dispatch.execute(action);
38    }
39
40    @Override
41    public void undo(String cookieSentByRPC, Action<Result> action,
42            Result result) throws ActionException, ServiceException {
43        dispatch.undo(action, result);
44    }
45
46}