INT-1848 Add order Attribute (rmi)

This commit is contained in:
Gary Russell
2011-04-30 13:34:19 -04:00
parent bf55b88e54
commit 4779909d80
4 changed files with 25 additions and 4 deletions

View File

@@ -326,6 +326,7 @@ project('spring-integration-rmi') {
compile project(":spring-integration-core")
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-context:$springVersion"
testCompile project(":spring-integration-test")
}
// suppress deprecation warnings (@SuppressWarnings("deprecation") is not enough for javac)

View File

@@ -60,6 +60,14 @@
<xsd:attribute name="host" type="xsd:string" use="required"/>
<xsd:attribute name="port" type="xsd:string"/>
<xsd:attribute name="remote-channel" type="xsd:string" use="required"/>
<xsd:attribute name="order">
<xsd:annotation>
<xsd:documentation>
Specifies the order for invocation when this endpoint is connected as a
subscriber to a SubscribableChannel.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@ import static org.junit.Assert.assertNotNull;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.Message;
@@ -29,15 +28,17 @@ import org.springframework.integration.MessageChannel;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.message.GenericMessage;
import org.springframework.integration.rmi.RmiInboundGateway;
import org.springframework.integration.rmi.RmiOutboundGateway;
import org.springframework.integration.test.util.TestUtils;
/**
* @author Mark Fisher
* @author Gary Russell
*/
public class RmiOutboundGatewayParserTests {
private final QueueChannel testChannel = new QueueChannel();
@Before
@SuppressWarnings("deprecation")
public void setupTestInboundGateway() throws Exception {
@@ -48,6 +49,13 @@ public class RmiOutboundGatewayParserTests {
gateway.afterPropertiesSet();
}
@Test
public void testOrder() {
ApplicationContext context = new ClassPathXmlApplicationContext(
"rmiOutboundGatewayParserTests.xml", this.getClass());
RmiOutboundGateway gateway = context.getBean(RmiOutboundGateway.class);
assertEquals(23, TestUtils.getPropertyValue(gateway, "order"));
}
@Test
public void directInvocation() {

View File

@@ -12,6 +12,10 @@
<channel id="localChannel"/>
<rmi:outbound-gateway id="gateway" request-channel="localChannel" remote-channel="testChannel" host="localhost"/>
<rmi:outbound-gateway id="gateway"
order="23"
request-channel="localChannel"
remote-channel="testChannel"
host="localhost"/>
</beans:beans>