com.google.gwt.user.server.rpc
Class HybridServiceServlet

java.lang.Object
  extended by HttpServlet
      extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
          extended by com.google.gwt.rpc.server.RpcServlet
              extended by com.google.gwt.user.server.rpc.HybridServiceServlet
All Implemented Interfaces:
SerializationPolicyProvider
Direct Known Subclasses:
JUnitHostImpl

public class HybridServiceServlet
extends RpcServlet
implements SerializationPolicyProvider

EXPERIMENTAL and subject to change. Do not use this in production code.

This RemoteServiceServlet provides support for both legacy and deRPC clients at the cost of additional runtime overhead and API complexity.


Constructor Summary
HybridServiceServlet()
           
 
Method Summary
 ClientOracle getClientOracle()
          This method will return null instead of throwing an exception.
 SerializationPolicy getSerializationPolicy(java.lang.String moduleBaseURL, java.lang.String strongName)
          Returns a SerializationPolicy for a given module base URL and serialization policy strong name.
 void processCall(ClientOracle clientOracle, java.lang.String payload, java.io.OutputStream stream)
          Process a call originating from the given request.
 java.lang.String processCall(java.lang.String payload)
           
 
Methods inherited from class com.google.gwt.rpc.server.RpcServlet
processPost
 
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HybridServiceServlet

public HybridServiceServlet()
Method Detail

getClientOracle

public ClientOracle getClientOracle()
This method will return null instead of throwing an exception.

Overrides:
getClientOracle in class RpcServlet

getSerializationPolicy

public final SerializationPolicy getSerializationPolicy(java.lang.String moduleBaseURL,
                                                        java.lang.String strongName)
Description copied from interface: SerializationPolicyProvider
Returns a SerializationPolicy for a given module base URL and serialization policy strong name.

Specified by:
getSerializationPolicy in interface SerializationPolicyProvider
Parameters:
moduleBaseURL - the URL for the module
strongName - strong name of the serialization policy for the specified module URL
Returns:
a SerializationPolicy for a given module base URL and RPC strong name; must not return null

processCall

public void processCall(ClientOracle clientOracle,
                        java.lang.String payload,
                        java.io.OutputStream stream)
                 throws SerializationException
Description copied from class: RpcServlet
Process a call originating from the given request. Uses the RPC.invokeAndStreamResponse(Object, java.lang.reflect.Method, Object[], ClientOracle, OutputStream) method to do the actual work.

Subclasses may optionally override this method to handle the payload in any way they desire (by routing the request to a framework component, for instance). The HttpServletRequest and HttpServletResponse can be accessed via the AbstractRemoteServiceServlet.getThreadLocalRequest() and AbstractRemoteServiceServlet.getThreadLocalResponse() methods.

This is public so that it can be unit tested easily without HTTP.

Overrides:
processCall in class RpcServlet
Parameters:
clientOracle - the ClientOracle that will be used to interpret the request
payload - the UTF-8 request payload
stream - the OutputStream that will receive the encoded response
Throws:
SerializationException - if we cannot serialize the response

processCall

public java.lang.String processCall(java.lang.String payload)
                             throws SerializationException
Throws:
SerializationException