public class HybridServiceServlet extends RpcServlet implements SerializationPolicyProvider
This RemoteServiceServlet provides support for both legacy and deRPC clients at the cost of additional runtime overhead and API complexity.
CLIENT_ORACLE_EXTENSIONperThreadRequest, perThreadResponse| Constructor and Description |
|---|
HybridServiceServlet() |
| Modifier and Type | Method and Description |
|---|---|
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. |
ClientOracle |
getClientOracle()
This method will return
null instead of throwing an exception. |
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) |
void |
processCall(ClientOracle clientOracle,
java.lang.String payload,
java.io.OutputStream stream)
Process a call originating from the given request.
|
java.lang.String |
processCall(java.lang.String payload) |
allowHostedModeConnections, findClientOracleData, getRequestModuleBasePath, processPost, shouldCompressResponsedoPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContentdoDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic ClientOracle getClientOracle()
null instead of throwing an exception.getClientOracle in class RpcServletpublic final SerializationPolicy getSerializationPolicy(java.lang.String moduleBaseURL, java.lang.String strongName)
SerializationPolicyProviderSerializationPolicy for a given module base URL and
serialization policy strong name.getSerializationPolicy in interface SerializationPolicyProvidermoduleBaseURL - the URL for the modulestrongName - strong name of the serialization
policy for the specified module URLSerializationPolicy for a given module base URL and RPC
strong name; must not return nullpublic void processCall(ClientOracle clientOracle, java.lang.String payload, java.io.OutputStream stream) throws SerializationException
RpcServletRPC.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.
processCall in class RpcServletclientOracle - the ClientOracle that will be used to interpret the
requestpayload - the UTF-8 request payloadstream - the OutputStream that will receive the encoded responseSerializationException - if we cannot serialize the responsepublic java.lang.String processCall(java.lang.String payload)
throws SerializationException
SerializationExceptionprotected 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 fileSerializationPolicy for the given module base URL and
strong name, or null if there is noneprotected void onAfterResponseSerialized(java.lang.String serializedResponse)
serializedResponse -