From f0590ed578888a822da869aca125b7213135fd21 Mon Sep 17 00:00:00 2001 From: David Syer Date: Thu, 6 May 2010 14:21:50 +0000 Subject: [PATCH] INT-1126: rename timeout to expiry --- .../integration/aggregator/CorrelatingMessageHandler.java | 8 ++++---- .../integration/annotation/Aggregator.java | 4 ++-- .../annotation/AggregatorAnnotationPostProcessor.java | 2 +- .../integration/config/xml/AggregatorParser.java | 2 +- .../integration/config/xml/ResequencerParser.java | 2 +- .../integration/config/xml/spring-integration-2.0.xsd | 4 ++-- .../integration/aggregator/AggregatorTests.java | 2 +- .../integration/aggregator/ConcurrentAggregatorTests.java | 2 +- .../integration/aggregator/ResequencerTests.java | 6 +++--- .../integration/config/AggregatorParserTests.java | 2 +- .../integration/config/ResequencerParserTests.java | 4 ++-- .../integration/config/aggregatorParserTests.xml | 2 +- .../config/annotation/AggregatorAnnotationTests.java | 4 ++-- .../TestAnnotatedEndpointWithCustomizedAggregator.java | 2 +- .../integration/config/resequencerParserTests.xml | 2 +- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageHandler.java b/org.springframework.integration/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageHandler.java index 7acab17a59..0c979f4beb 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageHandler.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/aggregator/CorrelatingMessageHandler.java @@ -72,7 +72,7 @@ public class CorrelatingMessageHandler extends AbstractMessageHandler implements private volatile MessageChannel discardChannel = new NullChannel(); - private boolean sendPartialResultOnTimeout = false; + private boolean sendPartialResultOnExpiry = false; private final ConcurrentMap locks = new ConcurrentHashMap(); @@ -132,8 +132,8 @@ public class CorrelatingMessageHandler extends AbstractMessageHandler implements this.channelTemplate.setSendTimeout(sendTimeout); } - public void setSendPartialResultOnTimeout(boolean sendPartialResultOnTimeout) { - this.sendPartialResultOnTimeout = sendPartialResultOnTimeout; + public void setSendPartialResultOnExpiry(boolean sendPartialResultOnExpiry) { + this.sendPartialResultOnExpiry = sendPartialResultOnExpiry; } @Override @@ -209,7 +209,7 @@ public class CorrelatingMessageHandler extends AbstractMessageHandler implements remove(group); } else { - if (sendPartialResultOnTimeout) { + if (sendPartialResultOnExpiry) { if (logger.isInfoEnabled()) { logger.info("Processing partially complete messages for key [" + correlationKey + "] to: " + outputChannel); diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Aggregator.java b/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Aggregator.java index af26a1bfc5..09324175fd 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Aggregator.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/annotation/Aggregator.java @@ -59,8 +59,8 @@ public @interface Aggregator { long sendTimeout() default CorrelatingMessageHandler.DEFAULT_SEND_TIMEOUT; /** - * indicates whether to send an incomplete aggregate on timeout + * indicates whether to send an incomplete aggregate on expiry of the message group */ - boolean sendPartialResultsOnTimeout() default false; + boolean sendPartialResultsOnExpiry() default false; } diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/AggregatorAnnotationPostProcessor.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/AggregatorAnnotationPostProcessor.java index a63c361074..f722c03bf1 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/AggregatorAnnotationPostProcessor.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/AggregatorAnnotationPostProcessor.java @@ -65,7 +65,7 @@ public class AggregatorAnnotationPostProcessor extends AbstractMethodAnnotationP handler.setOutputChannel(this.channelResolver.resolveChannelName(outputChannelName)); } handler.setSendTimeout(annotation.sendTimeout()); - handler.setSendPartialResultOnTimeout(annotation.sendPartialResultsOnTimeout()); + handler.setSendPartialResultOnExpiry(annotation.sendPartialResultsOnExpiry()); handler.setBeanFactory(this.beanFactory); handler.afterPropertiesSet(); return handler; diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/AggregatorParser.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/AggregatorParser.java index 0bba1d487a..8ba4cfe85d 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/AggregatorParser.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/AggregatorParser.java @@ -50,7 +50,7 @@ public class AggregatorParser extends AbstractConsumerEndpointParser { private static final String SEND_TIMEOUT_ATTRIBUTE = "send-timeout"; - private static final String SEND_PARTIAL_RESULT_ON_TIMEOUT_ATTRIBUTE = "send-partial-result-on-timeout"; + private static final String SEND_PARTIAL_RESULT_ON_TIMEOUT_ATTRIBUTE = "send-partial-result-on-expiry"; private static final String RELEASE_STRATEGY_PROPERTY = "releaseStrategy"; diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/ResequencerParser.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/ResequencerParser.java index 068baec22b..d528e87bf5 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/ResequencerParser.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/ResequencerParser.java @@ -64,7 +64,7 @@ public class ResequencerParser extends AbstractConsumerEndpointParser { IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "message-store"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "discard-channel"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-timeout"); - IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-partial-result-on-timeout"); + IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-partial-result-on-expiry"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "auto-startup"); return builder; } diff --git a/org.springframework.integration/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd b/org.springframework.integration/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd index 2874e3fe6a..5243a32eef 100644 --- a/org.springframework.integration/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd +++ b/org.springframework.integration/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd @@ -1764,7 +1764,7 @@ - + @@ -1832,7 +1832,7 @@ - + diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java index 961d5f16fd..6c00800815 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/AggregatorTests.java @@ -83,7 +83,7 @@ public class AggregatorTests { @Test public void testShouldSendPartialResultOnTimeoutTrue() throws InterruptedException { - this.aggregator.setSendPartialResultOnTimeout(true); + this.aggregator.setSendPartialResultOnExpiry(true); QueueChannel replyChannel = new QueueChannel(); Message message1 = createMessage(3, "ABC", 3, 1, replyChannel, null); Message message2 = createMessage(5, "ABC", 3, 2, replyChannel, null); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java index b4bb900bd4..5e48743f17 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ConcurrentAggregatorTests.java @@ -129,7 +129,7 @@ public class ConcurrentAggregatorTests { @Test public void testShouldSendPartialResultOnTimeoutTrue() throws InterruptedException { - this.aggregator.setSendPartialResultOnTimeout(true); + this.aggregator.setSendPartialResultOnExpiry(true); QueueChannel replyChannel = new QueueChannel(); Message message1 = createMessage(3, "ABC", 3, 1, replyChannel, null); Message message2 = createMessage(5, "ABC", 3, 2, replyChannel, null); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java index 1998bfeca2..c90502b625 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java @@ -158,7 +158,7 @@ public class ResequencerTests { Message message1 = createMessage("123", "ABC", 4, 2, null); Message message2 = createMessage("456", "ABC", 4, 1, null); Message message3 = createMessage("789", "ABC", 4, 4, null); - this.resequencer.setSendPartialResultOnTimeout(false); + this.resequencer.setSendPartialResultOnExpiry(false); this.processor.setReleasePartialSequences(false); this.resequencer.setDiscardChannel(discardChannel); this.resequencer.handleMessage(message1); @@ -186,7 +186,7 @@ public class ResequencerTests { QueueChannel discardChannel = new QueueChannel(); Message message1 = createMessage("123", "ABC", 4, 2, null); Message message2 = createMessage("456", "ABC", 5, 1, null); - this.resequencer.setSendPartialResultOnTimeout(false); + this.resequencer.setSendPartialResultOnExpiry(false); this.processor.setReleasePartialSequences(false); this.resequencer.setDiscardChannel(discardChannel); this.resequencer.handleMessage(message1); @@ -204,7 +204,7 @@ public class ResequencerTests { public void testResequencingWithWrongSequenceSizeAndNumber() throws InterruptedException { QueueChannel discardChannel = new QueueChannel(); Message message1 = createMessage("123", "ABC", 2, 4, null); - this.resequencer.setSendPartialResultOnTimeout(false); + this.resequencer.setSendPartialResultOnExpiry(false); this.processor.setReleasePartialSequences(false); this.resequencer.setDiscardChannel(discardChannel); this.resequencer.handleMessage(message1); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java index ee7b27384c..22f0baa7e9 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java @@ -100,7 +100,7 @@ public class AggregatorParserTests { 86420000l, TestUtils.getPropertyValue(consumer, "channelTemplate.sendTimeout")); Assert.assertEquals( "The AggregatorEndpoint is not configured with the appropriate 'send partial results on timeout' flag", - true, accessor.getPropertyValue("sendPartialResultOnTimeout")); + true, accessor.getPropertyValue("sendPartialResultOnExpiry")); } @Test diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/ResequencerParserTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/ResequencerParserTests.java index f719e9e808..4768a49a9f 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/ResequencerParserTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/ResequencerParserTests.java @@ -86,7 +86,7 @@ public class ResequencerParserTests { resequencer, "channelTemplate.sendTimeout")); assertEquals( "The ResequencerEndpoint is not configured with the appropriate 'send partial results on timeout' flag", - false, getPropertyValue(resequencer, "sendPartialResultOnTimeout")); + false, getPropertyValue(resequencer, "sendPartialResultOnExpiry")); assertEquals("The ResequencerEndpoint is not configured with the appropriate 'release partial sequences' flag", false, getPropertyValue(getPropertyValue(resequencer, "outputProcessor"), "releasePartialSequences")); } @@ -106,7 +106,7 @@ public class ResequencerParserTests { getPropertyValue(resequencer, "channelTemplate.sendTimeout")); assertEquals( "The ResequencerEndpoint is not configured with the appropriate 'send partial results on timeout' flag", - true, getPropertyValue(resequencer, "sendPartialResultOnTimeout")); + true, getPropertyValue(resequencer, "sendPartialResultOnExpiry")); assertEquals("The ResequencerEndpoint is not configured with the appropriate 'release partial sequences' flag", false, getPropertyValue(getPropertyValue(resequencer, "outputProcessor"), "releasePartialSequences")); } diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/aggregatorParserTests.xml b/org.springframework.integration/src/test/java/org/springframework/integration/config/aggregatorParserTests.xml index c216cd080d..6d2d14c863 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/aggregatorParserTests.xml +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/aggregatorParserTests.xml @@ -27,7 +27,7 @@ release-strategy="releaseStrategy" correlation-strategy="correlationStrategy" send-timeout="86420000" - send-partial-result-on-timeout="true"/> + send-partial-result-on-expiry="true"/> aggregatingMethod(List> messages) { List> sortableList = new ArrayList>(messages); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/resequencerParserTests.xml b/org.springframework.integration/src/test/java/org/springframework/integration/config/resequencerParserTests.xml index a43fb9c399..ec075f060c 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/resequencerParserTests.xml +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/resequencerParserTests.xml @@ -32,7 +32,7 @@ output-channel="outputChannel" discard-channel="discardChannel" send-timeout="86420000" - send-partial-result-on-timeout="true" + send-partial-result-on-expiry="true" release-partial-sequences="false"/>