|
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.rpc.server.RpcServlet
public class RpcServlet
EXPERIMENTAL and subject to change. Do not use this in production code.
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 | |
---|---|
protected static java.lang.String |
CLIENT_ORACLE_EXTENSION
|
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet |
---|
perThreadRequest, perThreadResponse |
Constructor Summary | |
---|---|
RpcServlet()
The default constructor. |
Method Summary | |
---|---|
protected boolean |
allowHostedModeConnections()
Indicates whether or not an RPC request from a hosted mode client should be serviced. |
protected java.io.InputStream |
findClientOracleData(java.lang.String requestModuleBasePath,
java.lang.String permutationStrongName)
Override this method to control access to permutation-specific data. |
ClientOracle |
getClientOracle()
This method creates the ClientOracle that will provide data about the remote client. |
protected java.lang.String |
getRequestModuleBasePath()
Extract the module's base path from the current request. |
void |
processCall(ClientOracle clientOracle,
java.lang.String payload,
java.io.OutputStream stream)
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)
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 |
Field Detail |
---|
protected static final java.lang.String CLIENT_ORACLE_EXTENSION
Constructor Detail |
---|
public RpcServlet()
Method Detail |
---|
public ClientOracle getClientOracle() throws SerializationException
findClientOracleData(String, String)
to obtain access to
ClientOracle data emitted by the GWT compiler.
SerializationException
public void processCall(ClientOracle clientOracle, java.lang.String payload, java.io.OutputStream stream) throws SerializationException
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.
clientOracle
- the ClientOracle that will be used to interpret the
requestpayload
- the UTF-8 request payloadstream
- the OutputStream that will receive the encoded response
SerializationException
- if we cannot serialize the responsepublic final void processPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException, SerializationException
processPost
in class AbstractRemoteServiceServlet
java.io.IOException
javax.servlet.ServletException
SerializationException
protected boolean allowHostedModeConnections()
The default implementation allows hosted-mode connections from the local host, loopback addresses (127.*), site local (RFC 1918), link local (169.254/16) addresses, and their IPv6 equivalents.
true
if a hosted mode connection should be allowedAbstractRemoteServiceServlet.getThreadLocalRequest()
,
InetAddress
protected java.io.InputStream findClientOracleData(java.lang.String requestModuleBasePath, java.lang.String permutationStrongName) throws SerializationException
The default implementation attempts to load the file from the
ServletContext as
requestModuleBasePath + permutationStrongName + CLIENT_ORACLE_EXTENSION
requestModuleBasePath
- the module's base path, modulo protocol and
host, as reported by getRequestModuleBasePath()
permutationStrongName
- the module's strong name as reported by
AbstractRemoteServiceServlet.getPermutationStrongName()
SerializationException
protected final java.lang.String getRequestModuleBasePath()
GWT.getModuleBaseURL()
or
null
if the request did not contain the
"X-GWT-Module-Base" headerprotected boolean shouldCompressResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
This implementation currently returns true
if the request
originates from a non-local address. Subclasses can override this logic.
request
- the request being servedresponse
- the response that will be written into
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 |