public class

HybridServiceServlet

extends RpcServlet
implements SerializationPolicyProvider
java.lang.Object
   ↳ javax.servlet.GenericServlet
     ↳ javax.servlet.http.HttpServlet
       ↳ com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
         ↳ com.google.gwt.rpc.server.RpcServlet
           ↳ com.google.gwt.user.server.rpc.HybridServiceServlet
Known Direct Subclasses

Class Overview

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.

Summary

[Expand]
Inherited Constants
From class com.google.gwt.rpc.server.RpcServlet
[Expand]
Inherited Fields
From class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
Public Constructors
HybridServiceServlet()
Public Methods
ClientOracle getClientOracle()
This method will return null instead of throwing an exception.
final SerializationPolicy getSerializationPolicy(String moduleBaseURL, String strongName)
Returns a SerializationPolicy for a given module base URL and serialization policy strong name.
String processCall(String payload)
void processCall(ClientOracle clientOracle, String payload, OutputStream stream)
Process a call originating from the given request.
Protected Methods
SerializationPolicy doGetSerializationPolicy(HttpServletRequest request, String moduleBaseURL, String strongName)
Gets the SerializationPolicy for given module base URL and strong name if there is one.
void onAfterResponseSerialized(String serializedResponse)
[Expand]
Inherited Methods
From class com.google.gwt.rpc.server.RpcServlet
From class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
From class javax.servlet.http.HttpServlet
From class javax.servlet.GenericServlet
From class java.lang.Object
From interface com.google.gwt.user.server.rpc.SerializationPolicyProvider
From interface javax.servlet.Servlet
From interface javax.servlet.ServletConfig

Public Constructors

public HybridServiceServlet ()

Public Methods

public ClientOracle getClientOracle ()

This method will return null instead of throwing an exception.

public final SerializationPolicy getSerializationPolicy (String moduleBaseURL, String strongName)

Returns a SerializationPolicy for a given module base URL and serialization policy strong name.

Parameters
moduleBaseURL the URL for the module
strongName strong name of the serialization policy for the specified module URL
Returns

public String processCall (String payload)

public void processCall (ClientOracle clientOracle, String payload, OutputStream stream)

Process a call originating from the given request. Uses the 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 getThreadLocalRequest() and getThreadLocalResponse() methods.

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

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

Protected Methods

protected SerializationPolicy doGetSerializationPolicy (HttpServletRequest request, String moduleBaseURL, String strongName)

Gets the SerializationPolicy for given module base URL and strong name if there is one. Override this method to provide a SerializationPolicy using an alternative approach.

Parameters
request the HTTP request being serviced
moduleBaseURL as specified in the incoming payload
strongName a strong name that uniquely identifies a serialization policy file
Returns

protected void onAfterResponseSerialized (String serializedResponse)