|
GWT 2.0.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
com.google.gwt.user.server.rpc.RemoteServiceServlet
public class RemoteServiceServlet
The servlet base class for your RPC service implementations that automatically deserializes incoming requests from the client and serializes outgoing responses for client/server RPCs.
Field Summary |
---|
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet |
---|
perThreadRequest, perThreadResponse |
Constructor Summary | |
---|---|
RemoteServiceServlet()
The default constructor. |
Method Summary | |
---|---|
protected SerializationPolicy |
doGetSerializationPolicy(javax.servlet.http.HttpServletRequest request,
java.lang.String moduleBaseURL,
java.lang.String strongName)
Gets the SerializationPolicy for given module base URL and strong
name if there is one. |
SerializationPolicy |
getSerializationPolicy(java.lang.String moduleBaseURL,
java.lang.String strongName)
Returns a SerializationPolicy for a given module base URL and
serialization policy strong name. |
protected void |
onAfterResponseSerialized(java.lang.String serializedResponse)
Override this method to examine the serialized response that will be returned to the client. |
protected void |
onBeforeRequestDeserialized(java.lang.String serializedRequest)
Override this method to examine the serialized version of the request payload before it is deserialized into objects. |
java.lang.String |
processCall(java.lang.String payload)
Process a call originating from the given request. |
void |
processPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Standard HttpServlet method: handle the POST. |
protected boolean |
shouldCompressResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String responsePayload)
Determines whether the response to a given servlet request should or should not be GZIP compressed. |
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet |
---|
doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RemoteServiceServlet()
Method Detail |
---|
public final SerializationPolicy getSerializationPolicy(java.lang.String moduleBaseURL, java.lang.String strongName)
SerializationPolicyProvider
SerializationPolicy
for a given module base URL and
serialization policy strong name.
getSerializationPolicy
in interface SerializationPolicyProvider
moduleBaseURL
- the URL for the modulestrongName
- strong name of the serialization
policy for the specified module URL
SerializationPolicy
for a given module base URL and RPC
strong name; must not return null
public java.lang.String processCall(java.lang.String payload) throws SerializationException
RPC.invokeAndEncodeResponse(Object, java.lang.reflect.Method, Object[])
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.
payload
- the UTF-8 request payload
IncompatibleRemoteServiceException
SerializationException
- if we cannot serialize the response
UnexpectedException
- if the invocation throws a checked exception
that is not declared in the service method's signature
java.lang.RuntimeException
- if the service method throws an unchecked
exception (the exception will be the one thrown by the service)public final void processPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException, SerializationException
processPost
in class AbstractRemoteServiceServlet
javax.servlet.ServletException
SerializationException
java.io.IOException
protected SerializationPolicy doGetSerializationPolicy(javax.servlet.http.HttpServletRequest request, java.lang.String moduleBaseURL, java.lang.String strongName)
SerializationPolicy
for given module base URL and strong
name if there is one.
Override this method to provide a SerializationPolicy
using an
alternative approach.
request
- the HTTP request being servicedmoduleBaseURL
- as specified in the incoming payloadstrongName
- a strong name that uniquely identifies a serialization
policy file
SerializationPolicy
for the given module base URL and
strong name, or null
if there is noneprotected void onAfterResponseSerialized(java.lang.String serializedResponse)
serializedResponse
- protected void onBeforeRequestDeserialized(java.lang.String serializedRequest)
serializedRequest
- protected boolean shouldCompressResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String responsePayload)
This implementation currently returns true
if the response
string's estimated byte length is longer than 256 bytes. Subclasses can
override this logic.
request
- the request being servedresponse
- the response that will be written intoresponsePayload
- the payload that is about to be sent to the client
true
if responsePayload should be GZIP compressed,
otherwise false
.
|
GWT 2.0.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |