at.spardat.xma.rpc
Class RPCServletServer

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byat.spardat.xma.rpc.RPCServletServer
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class RPCServletServer
extends javax.servlet.http.HttpServlet

This servlet is the server side endpoint for XMA remote calls in components. The corresponding client class that is the communication partner is RemoteCall.

What this servlet roughly does, is:

  1. Deserialize a RemoteCallData object from the ServletInputStream. This is the data transmitted from the client.
  2. Extract the model changes from RemoteCallData and integrate the changes in the servers component buddy.
  3. Execute the server event method, where the control leaves the XMA-runtime and is handled over to the XMA program.
  4. Pack the changes the server side event method did in a RemoteReplyDataobject and write it to the servlet output stream.

See Also:
Serialized Form

Constructor Summary
RPCServletServer()
           
 
Method Summary
 void dispatchRemoteCall(ComponentServer component, RemoteCall call, RemoteReply reply)
          This method processes a remote call at the component level.
static boolean doCompress(int length)
          Determines if responses to the client of length should be compressed.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The post method that exactly does the things described above.
protected  void doPost0(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String measurementPraefix)
          The post method that exactly does the things described above.
 void init(javax.servlet.ServletConfig sc)
           
 
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, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RPCServletServer

public RPCServletServer()
Method Detail

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
The post method that exactly does the things described above.

Throws:
javax.servlet.ServletException
java.io.IOException

init

public void init(javax.servlet.ServletConfig sc)
          throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException
See Also:
GenericServlet.init(javax.servlet.ServletConfig)

doPost0

protected void doPost0(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       java.lang.String measurementPraefix)
                throws javax.servlet.ServletException,
                       java.io.IOException
The post method that exactly does the things described above.

Throws:
javax.servlet.ServletException
java.io.IOException

doCompress

public static boolean doCompress(int length)
Determines if responses to the client of length should be compressed. This is driven by the property 'at.spardat.xma.RpcCompressionThreshold'. A value of -1 indicates no compression. Otherwise, the value of the property indicates the minimum length of a stream where compression is activated at.


dispatchRemoteCall

public void dispatchRemoteCall(ComponentServer component,
                               RemoteCall call,
                               RemoteReply reply)
This method processes a remote call at the component level. Its task is to internalize the model changes from the client, call the programmers server side event method and externalize the model changes.

Parameters:
component - the component where to dispatch the call
call - the remote request object as transmitted from the client
reply - the remote reply object that is going to hold the reply data