org.springframework.integration.adapter.httpinvoker
Class HttpInvokerGateway
java.lang.Object
org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.gateway.SimpleMessagingGateway
org.springframework.integration.adapter.AbstractRemotingGateway
org.springframework.integration.adapter.httpinvoker.HttpInvokerGateway
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, MessageBusAware, MessagingGateway, MessageHandler, org.springframework.web.HttpRequestHandler
public class HttpInvokerGateway
- extends AbstractRemotingGateway
- implements org.springframework.web.HttpRequestHandler, org.springframework.beans.factory.InitializingBean
A 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 |
private org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter |
exporter
|
Method Summary |
void |
afterPropertiesSet()
|
void |
handleRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
Methods inherited from class org.springframework.integration.gateway.SimpleMessagingGateway |
receive, receiveAndForward, send, sendAndReceive, sendAndReceiveMessage, setMessageBus, setMessageCreator, setMessageMapper, setReplyChannel, setReplyMapCapacity, setReplyTimeout, setRequestChannel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
exporter
private volatile org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter exporter
HttpInvokerGateway
public HttpInvokerGateway(MessageChannel requestChannel)
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
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