diff --git a/.project b/.project new file mode 100755 index 000000000..b19164acb --- /dev/null +++ b/.project @@ -0,0 +1,29 @@ + + + spring-batch-admin + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + + diff --git a/spring-batch-admin-parent/pom.xml b/spring-batch-admin-parent/pom.xml index 9cd430bdb..eaeff001f 100644 --- a/spring-batch-admin-parent/pom.xml +++ b/spring-batch-admin-parent/pom.xml @@ -9,7 +9,7 @@ true 2.1.1.RELEASE - 3.0.2.RELEASE + 3.0.3.RELEASE 1.0.3.RELEASE @@ -536,12 +536,6 @@ ${project.version} compile - - org.springframework.integration - spring-integration-adapter - ${spring.integration.version} - compile - org.springframework.integration spring-integration-core diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptor.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptor.java index 2b6671713..5847e0370 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptor.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptor.java @@ -4,7 +4,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.integration.channel.ChannelInterceptor; -import org.springframework.integration.channel.ThreadLocalChannel; import org.springframework.integration.channel.interceptor.ChannelInterceptorAdapter; import org.springframework.integration.core.Message; import org.springframework.integration.core.MessageChannel; @@ -14,8 +13,8 @@ import org.springframework.util.Assert; /** * A {@link ChannelInterceptor} that turns a pollable channel into a "pass-thru channel": if a client calls * receive() on the channel it will delegate to a {@link MessageSource} to pull the message directly from - * an external source. This is particularly useful in combination with a {@link ThreadLocalChannel}, in which case the - * receive() can join a transaction which was started by the caller. + * an external source. This is particularly useful in combination with a message channel in thread scope, in which case + * the receive() can join a transaction which was started by the caller. * * @author Dave Syer * @@ -42,8 +41,8 @@ public class MessageSourcePollerInterceptor extends ChannelInterceptorAdapter im } /** - * Optional MessageChannel for injecting the message receieved from the source (defaults to the channel - * intercepted in {@link #preReceive(MessageChannel)}). + * Optional MessageChannel for injecting the message receieved from the source (defaults to the channel intercepted + * in {@link #preReceive(MessageChannel)}). * * @param channel the channel to set */ @@ -76,12 +75,12 @@ public class MessageSourcePollerInterceptor extends ChannelInterceptorAdapter im public boolean preReceive(MessageChannel channel) { Message message = source.receive(); if (message != null) { - if (this.channel!=null) { + if (this.channel != null) { channel = this.channel; } channel.send(message); if (logger.isDebugEnabled()) { - logger.debug("Sent " + message + " to channel " + channel.getName()); + logger.debug("Sent " + message + " to channel " + channel); } return true; } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptorTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptorTests.java index 5d043f67c..a7cecf92d 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptorTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/chunk/MessageSourcePollerInterceptorTests.java @@ -4,7 +4,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.Test; -import org.springframework.integration.channel.ThreadLocalChannel; +import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.core.Message; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.MessageSource; @@ -33,7 +33,7 @@ public class MessageSourcePollerInterceptorTests { @Test public void testPreReceive() throws Exception { MessageSourcePollerInterceptor interceptor = new MessageSourcePollerInterceptor(new TestMessageSource("foo")); - ThreadLocalChannel channel = new ThreadLocalChannel(); + QueueChannel channel = new QueueChannel(); assertTrue(interceptor.preReceive(channel)); assertEquals("foo", channel.receive(10L).getPayload()); } diff --git a/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingMessageHandlerIntegrationTests.java b/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingMessageHandlerIntegrationTests.java index 082427eb1..a33389006 100644 --- a/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingMessageHandlerIntegrationTests.java +++ b/spring-batch-integration/src/test/java/org/springframework/batch/integration/launch/JobLaunchingMessageHandlerIntegrationTests.java @@ -42,7 +42,10 @@ public class JobLaunchingMessageHandlerIntegrationTests { @Before public void setUp() { - responseChannel.purge(null); + Object message = ""; + while (message!=null) { + message = responseChannel.receive(10L); + } } @Test