1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.wysiwyg.server

File XWikiRemoteServiceServlet.java

 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
54% of files have more coverage

Code metrics

0
6
1
1
60
26
2
0.33
6
1
2

Classes

Class Line # Actions
XWikiRemoteServiceServlet 40 6 0% 2 2
0.7142857371.4%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.wysiwyg.server;
21   
22    import java.lang.reflect.Type;
23   
24    import com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException;
25    import com.google.gwt.user.client.rpc.RemoteService;
26    import com.google.gwt.user.client.rpc.SerializationException;
27    import com.google.gwt.user.server.rpc.RPC;
28    import com.google.gwt.user.server.rpc.RPCRequest;
29    import com.google.gwt.user.server.rpc.RemoteServiceServlet;
30    import com.xpn.xwiki.web.Utils;
31   
32    /**
33    * Generic {@link RemoteServiceServlet} that dispatches the RPC calls to components registered through the component
34    * manager.
35    * <p>
36    * See http://stuffthathappens.com/blog/2009/09/14/guice-with-gwt/.
37    *
38    * @version $Id: dc39f7e49513596e0e81e53c3dc6e4742e1f3110 $
39    */
 
40    public class XWikiRemoteServiceServlet extends RemoteServiceServlet
41    {
42    /**
43    * Field required by all {@link java.io.Serializable} classes.
44    */
45    private static final long serialVersionUID = 1911611911891893986L;
46   
 
47  3 toggle @Override
48    public String processCall(String payload) throws SerializationException
49    {
50  3 try {
51  3 RPCRequest req = RPC.decodeRequest(payload, null, this);
52  3 RemoteService service = (RemoteService) Utils.getComponent((Type) req.getMethod().getDeclaringClass());
53  3 return RPC.invokeAndEncodeResponse(service, req.getMethod(), req.getParameters(),
54    req.getSerializationPolicy());
55    } catch (IncompatibleRemoteServiceException ex) {
56  0 log("IncompatibleRemoteServiceException in the processCall(String) method.", ex);
57  0 return RPC.encodeResponseForFailure(null, ex);
58    }
59    }
60    }