org.springframework.integration.httpinvoker
Class HttpInvokerInboundGateway

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.gateway.AbstractMessagingGateway
              extended by org.springframework.integration.gateway.SimpleMessagingGateway
                  extended by org.springframework.integration.adapter.RemotingInboundGatewaySupport
                      extended by org.springframework.integration.httpinvoker.HttpInvokerInboundGateway
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, RemoteMessageHandler, MessagingGateway, org.springframework.web.HttpRequestHandler

public class HttpInvokerInboundGateway
extends RemotingInboundGatewaySupport
implements org.springframework.web.HttpRequestHandler

An inbound gateway 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>httpInvokerGateway</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.context.ContextLoaderListener:
 <bean id="httpInvokerGateway" class="org.springframework.integration.adapter.httpinvoker.HttpInvokerGateway">
     <constructor-arg ref="requestChannel"/>
 </bean>
 

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

Author:
Mark Fisher

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
HttpInvokerInboundGateway()
           
 
Method Summary
 void handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void onInit()
           
 
Methods inherited from class org.springframework.integration.adapter.RemotingInboundGatewaySupport
handle, setExpectReply
 
Methods inherited from class org.springframework.integration.gateway.SimpleMessagingGateway
fromMessage, toMessage
 
Methods inherited from class org.springframework.integration.gateway.AbstractMessagingGateway
doStart, doStop, receive, send, sendAndReceive, sendAndReceiveMessage, setReplyChannel, setReplyTimeout, setRequestChannel, setRequestTimeout, setShouldThrowErrors
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
afterPropertiesSet, isRunning, setAutoStartup, setTaskScheduler, start, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
getBeanFactory, getBeanName, getChannelResolver, getTaskScheduler, setBeanFactory, setBeanName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpInvokerInboundGateway

public HttpInvokerInboundGateway()
Method Detail

onInit

protected void onInit()
               throws java.lang.Exception
Overrides:
onInit in class AbstractMessagingGateway
Throws:
java.lang.Exception

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