org.openswing.swing.util.server
Class HessianObjectReceiver

java.lang.Object
  extended byorg.openswing.swing.util.server.ObjectReceiver
      extended byorg.openswing.swing.util.server.HessianObjectReceiver

public class HessianObjectReceiver
extends ObjectReceiver

Title: OpenSwing Framework

Description: Base class used to comunicate with the the client-side layer, via HTTP. it provides two utility methods: one to receive a service request through an ObjectInputStream and the other to send a serialized object as response to that service request. IO streams are wrapped through Hessian library.

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it


Constructor Summary
HessianObjectReceiver()
           
 
Method Summary
 Command getObjectFromRequest(javax.servlet.http.HttpServletRequest request)
          Receive a serialized object, through the provided HTTP request.
 void setObjectToResponse(javax.servlet.http.HttpServletResponse response, java.lang.Object objectToSend)
          Send a serialized object as response to a service request, through the provided HTTP response.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HessianObjectReceiver

public HessianObjectReceiver()
Method Detail

getObjectFromRequest

public final Command getObjectFromRequest(javax.servlet.http.HttpServletRequest request)
                                   throws java.lang.Exception
Receive a serialized object, through the provided HTTP request. Object is deserialized using Hessian library.

Specified by:
getObjectFromRequest in class ObjectReceiver
Parameters:
request - HTTP request that containes the serialized object
Returns:
service request
Throws:
java.lang.Exception

setObjectToResponse

public final void setObjectToResponse(javax.servlet.http.HttpServletResponse response,
                                      java.lang.Object objectToSend)
                               throws java.lang.Exception
Send a serialized object as response to a service request, through the provided HTTP response. Object is serialized using Hessian library.

Specified by:
setObjectToResponse in class ObjectReceiver
Parameters:
response - HTTP response used to send the response object
objectToSend - serialized object to send as response to the service request
Throws:
java.lang.Exception