|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectHttpServlet
com.google.gwt.user.server.rpc.OpenRemoteServiceServlet
public class OpenRemoteServiceServlet
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. This version is a modified version of RemoteServiceServlet. The only changes have been to remove some final declarations and to convert some private methods to protected to allow extension of this class.
Constructor Summary | |
---|---|
OpenRemoteServiceServlet()
The default constructor. |
Method Summary | |
---|---|
void |
doPost(HttpServletRequest request,
HttpServletResponse response)
This is called internally. |
protected HttpServletRequest |
getThreadLocalRequest()
Gets the HttpServletRequest object for the current call. |
protected HttpServletResponse |
getThreadLocalResponse()
Gets the HttpServletResponse object for the current call. |
protected void |
handleException(String responsePayload,
Throwable caught)
|
protected void |
onAfterResponseSerialized(String serializedResponse)
Override this method to examine the serialized response that will be returned to the client. |
protected void |
onBeforeRequestDeserialized(String serializedRequest)
Override this method to examine the serialized version of the request payload before it is deserialized into objects. |
String |
processCall(String payload)
This is public so that it can be unit tested easily without HTTP. |
protected String |
readPayloadAsUtf8(HttpServletRequest request)
|
protected void |
respondWithFailure(HttpServletResponse response,
Throwable caught)
Called when the machinery of this class itself has a problem, rather than the invoked third-party method. |
protected boolean |
shouldCompressResponse(HttpServletRequest request,
HttpServletResponse response,
String responsePayload)
Determines whether the response to a given servlet request should or should not be GZIP compressed. |
protected void |
writeResponse(HttpServletRequest request,
HttpServletResponse response,
String responsePayload)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OpenRemoteServiceServlet()
Method Detail |
---|
public void doPost(HttpServletRequest request, HttpServletResponse response)
public String processCall(String payload) throws SerializationException
SerializationException
protected void handleException(String responsePayload, Throwable caught)
protected final HttpServletRequest getThreadLocalRequest()
HttpServletRequest
object for the current call.
It is stored thread-locally so that simultaneous invocations can have
different request objects.
protected final HttpServletResponse getThreadLocalResponse()
HttpServletResponse
object for the current call.
It is stored thread-locally so that simultaneous invocations can have
different response objects.
protected void onAfterResponseSerialized(String serializedResponse)
protected void onBeforeRequestDeserialized(String serializedRequest)
protected boolean shouldCompressResponse(HttpServletRequest request, HttpServletResponse response, 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
.protected String readPayloadAsUtf8(HttpServletRequest request) throws IOException, ServletException
IOException
ServletException
protected void respondWithFailure(HttpServletResponse response, Throwable caught)
protected void writeResponse(HttpServletRequest request, HttpServletResponse response, String responsePayload) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |