org.springframework.remoting.httpinvoker
Class HttpInvokerServiceExporter

java.lang.Object
  extended byorg.springframework.remoting.support.RemoteExporter
      extended byorg.springframework.remoting.support.RemoteInvocationBasedExporter
          extended byorg.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
All Implemented Interfaces:
Controller, InitializingBean

public class HttpInvokerServiceExporter
extends RemoteInvocationBasedExporter
implements Controller, InitializingBean

Web controller that exports the specified service bean as HTTP invoker service endpoint, accessible via an HTTP invoker proxy.

Simply deserializes remote invocation objects and serializes remote invocation results. Uses Java serialization just like RMI, but provides the same ease of setup as Caucho's HTTP-based Hessian and Burlap protocols.

Since:
1.1
Author:
Juergen Hoeller
See Also:
HttpInvokerProxyFactoryBean

Field Summary
protected static String CONTENT_TYPE_SERIALIZED_OBJECT
           
 
Fields inherited from class org.springframework.remoting.support.RemoteExporter
logger
 
Constructor Summary
HttpInvokerServiceExporter()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
          Read a remote invocation from the request and write a remote invocation result to the response.
protected  RemoteInvocation readRemoteInvocation(HttpServletRequest request)
          Read a RemoteInvocation from the given HTTP request.
protected  void writeRemoteInvocationResult(HttpServletResponse response, RemoteInvocationResult result)
          Write the given RemoteInvocationResult to the given HTTP response.
 
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter
getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutor
 
Methods inherited from class org.springframework.remoting.support.RemoteExporter
checkService, checkServiceInterface, getProxyForService, getService, getServiceInterface, setService, setServiceInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_TYPE_SERIALIZED_OBJECT

protected static final String CONTENT_TYPE_SERIALIZED_OBJECT
See Also:
Constant Field Values
Constructor Detail

HttpInvokerServiceExporter

public HttpInvokerServiceExporter()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Description copied from interface: InitializingBean
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface InitializingBean

handleRequest

public ModelAndView handleRequest(HttpServletRequest request,
                                  HttpServletResponse response)
                           throws IOException,
                                  ClassNotFoundException
Read a remote invocation from the request and write a remote invocation result to the response.

Specified by:
handleRequest in interface Controller
Parameters:
request - current HTTP request
response - current HTTP response
Returns:
a ModelAndView to render, or null if handled directly
Throws:
IOException
ClassNotFoundException

readRemoteInvocation

protected RemoteInvocation readRemoteInvocation(HttpServletRequest request)
                                         throws IOException,
                                                ClassNotFoundException
Read a RemoteInvocation from the given HTTP request.

Parameters:
request - current HTTP request
Returns:
the RemoteInvocation object
Throws:
IOException - if thrown by operations on the request
ClassNotFoundException - if thrown by deserialization

writeRemoteInvocationResult

protected void writeRemoteInvocationResult(HttpServletResponse response,
                                           RemoteInvocationResult result)
                                    throws IOException
Write the given RemoteInvocationResult to the given HTTP response.

Parameters:
response - current HTTP response
result - the RemoteInvocationResult object
Throws:
IOException - if thrown by operations on the response


Copyright (C) 2003-2004 The Spring Framework Project.