org.springframework.integration.adapter.httpinvoker
Class HttpInvokerSourceAdapter

java.lang.Object
  extended by org.springframework.integration.adapter.MessageHandlingSourceAdapter
      extended by org.springframework.integration.adapter.httpinvoker.HttpInvokerSourceAdapter
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, MessageHandler, org.springframework.web.HttpRequestHandler

public class HttpInvokerSourceAdapter
extends MessageHandlingSourceAdapter
implements org.springframework.web.HttpRequestHandler

A source channel adapter for HttpInvoker-based remoting. Since this class implements HttpRequestHandler, it can be configured with a delegating Servlet where the servlet-name matches this adapter's bean name. For example, the following servlet can be defined in web.xml:

 <servlet>
     <servlet-name>httpInvokerSourceAdapter</servlet-name>
     <servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class>
 </servlet>
 
And, this would match the following bean definition in the application context loaded by a org.springframework.web.contextContextLoaderListener:
 <bean id="httpInvokerSourceAdapter" class="org.springframework.integration.adapter.httpinvoker.HttpInvokerSourceAdapter">
     <constructor-arg ref="exampleChannel"/>
 </bean>
 

Alternatively, in a Spring MVC application, the DispatcherServlet can delegate to the "httpInvokerSourceAdapter" bean based on a handler mapping configuration. In that case, the HttpRequestHandlerServlet would not be necessary.

Author:
Mark Fisher

Field Summary
private  org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter exporter
           
 
Fields inherited from class org.springframework.integration.adapter.MessageHandlingSourceAdapter
lifecycleMonitor
 
Constructor Summary
HttpInvokerSourceAdapter(MessageChannel channel)
           
 
Method Summary
 void handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void initialize()
          Subclasses may override this method for initialization.
 
Methods inherited from class org.springframework.integration.adapter.MessageHandlingSourceAdapter
afterPropertiesSet, getChannel, handle, setExpectReply, setReplyTimeout, setRequestTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exporter

private volatile org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter exporter
Constructor Detail

HttpInvokerSourceAdapter

public HttpInvokerSourceAdapter(MessageChannel channel)
Method Detail

initialize

public void initialize()
Description copied from class: MessageHandlingSourceAdapter
Subclasses may override this method for initialization.

Overrides:
initialize in class MessageHandlingSourceAdapter

handleRequest

public void handleRequest(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Specified by:
handleRequest in interface org.springframework.web.HttpRequestHandler
Throws:
javax.servlet.ServletException
java.io.IOException