站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

GWTRemoteServiceServlet (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.jboss.seam.remoting.gwt
Class GWTRemoteServiceServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class GWTRemoteServiceServlet
extends javax.servlet.http.HttpServlet

Author:
@hacker Michael Neale This is a less then ideal approach, but GWT (up to and including 1.3) has no means to get into the internals of the RPC mechanism, and free it from the shackles of the servlet API. So I, the liberator, have hacked this out of RemoteServiceServlet to do this, heretofore. When GWT 1.4 comes along to save us all, this can be retired, and the RPC utility class - as contributed by Rob Jellinghaus can be used instead.
See Also:
Serialized Form

Constructor Summary
GWTRemoteServiceServlet()
          The default constructor.
 
Method Summary
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This is called internally.
protected  javax.servlet.http.HttpServletRequest getThreadLocalRequest()
          Gets the HttpServletRequest object for the current call.
protected  javax.servlet.http.HttpServletResponse getThreadLocalResponse()
          Gets the HttpServletResponse object for the current call.
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  boolean shouldCompressResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String responsePayload)
          Determines whether the response to a given servlet request should or should not be GZIP compressed.
 
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

GWTRemoteServiceServlet

public GWTRemoteServiceServlet()
The default constructor.

Method Detail

doPost

public final void doPost(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
This is called internally.

Overrides:
doPost in class javax.servlet.http.HttpServlet

processCall

public String processCall(String payload)
                   throws com.google.gwt.user.client.rpc.SerializationException
This is public so that it can be unit tested easily without HTTP.

Throws:
com.google.gwt.user.client.rpc.SerializationException

getThreadLocalRequest

protected final javax.servlet.http.HttpServletRequest getThreadLocalRequest()
Gets the HttpServletRequest object for the current call. It is stored thread-locally so that simultaneous invocations can have different request objects.


getThreadLocalResponse

protected final javax.servlet.http.HttpServletResponse getThreadLocalResponse()
Gets the HttpServletResponse object for the current call. It is stored thread-locally so that simultaneous invocations can have different response objects.


onAfterResponseSerialized

protected void onAfterResponseSerialized(String serializedResponse)
Override this method to examine the serialized response that will be returned to the client. The default implementation does nothing and need not be called by subclasses.


onBeforeRequestDeserialized

protected void onBeforeRequestDeserialized(String serializedRequest)
Override this method to examine the serialized version of the request payload before it is deserialized into objects. The default implementation does nothing and need not be called by subclasses.


shouldCompressResponse

protected boolean shouldCompressResponse(javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         String responsePayload)
Determines whether the response to a given servlet request should or should not be GZIP compressed. This method is only called in cases where the requestor accepts GZIP encoding.

This implementation currently returns true if the response string's estimated byte length is longer than 256 bytes. Subclasses can override this logic.

Parameters:
request - the request being served
response - the response that will be written into
responsePayload - the payload that is about to be sent to the client
Returns:
true if responsePayload should be GZIP compressed, otherwise false.


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.