Added support for 'order' and 'auto-startup' on HTTP 'outbound-gateway'.

This commit is contained in:
Mark Fisher
2009-07-03 04:19:28 +00:00
parent 1536b3c539
commit 387ab9965c
3 changed files with 16 additions and 3 deletions

View File

@@ -128,6 +128,15 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="order" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Specifies the order for invocation when this gateway is connected as a
subscriber to a SubscribableChannel.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="auto-startup" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

View File

@@ -23,7 +23,9 @@
request-mapper="mapper"
request-executor="executor"
request-timeout="1234"
reply-channel="replies"/>
reply-channel="replies"
order="77"
auto-startup="false"/>
<outbound-gateway id="fullConfigWithoutMapper"
request-channel="requests"

View File

@@ -85,12 +85,14 @@ public class HttpOutboundGatewayParserTests {
@Test
public void fullConfigWithMapper() throws Exception {
HttpOutboundEndpoint gateway = (HttpOutboundEndpoint) new DirectFieldAccessor(
this.fullConfigWithMapperEndpoint).getPropertyValue("handler");
DirectFieldAccessor endpointAccessor = new DirectFieldAccessor(this.fullConfigWithMapperEndpoint);
HttpOutboundEndpoint gateway = (HttpOutboundEndpoint) endpointAccessor.getPropertyValue("handler");
MessageChannel requestChannel = (MessageChannel) new DirectFieldAccessor(
this.fullConfigWithMapperEndpoint).getPropertyValue("inputChannel");
assertEquals(this.applicationContext.getBean("requests"), requestChannel);
DirectFieldAccessor accessor = new DirectFieldAccessor(gateway);
assertEquals(77, accessor.getPropertyValue("order"));
assertEquals(Boolean.FALSE, endpointAccessor.getPropertyValue("autoStartup"));
Object replyChannel = accessor.getPropertyValue("outputChannel");
assertNotNull(replyChannel);
assertEquals(this.applicationContext.getBean("replies"), replyChannel);