removed IntervalTrigger, now replaced by PeriodicTrigger in the Spring 3.0 core
This commit is contained in:
@@ -42,9 +42,9 @@ import org.springframework.integration.message.GenericMessage;
|
||||
import org.springframework.integration.message.MessageBuilder;
|
||||
import org.springframework.integration.message.MessageSource;
|
||||
import org.springframework.integration.message.StringMessage;
|
||||
import org.springframework.integration.scheduling.IntervalTrigger;
|
||||
import org.springframework.integration.util.TestUtils;
|
||||
import org.springframework.integration.util.TestUtils.TestApplicationContext;
|
||||
import org.springframework.scheduling.support.PeriodicTrigger;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
@@ -185,7 +185,7 @@ public class ApplicationContextMessageBusTests {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
SourcePollingChannelAdapter channelAdapter = new SourcePollingChannelAdapter();
|
||||
channelAdapter.setSource(new FailingSource(latch));
|
||||
channelAdapter.setTrigger(new IntervalTrigger(1000));
|
||||
channelAdapter.setTrigger(new PeriodicTrigger(1000));
|
||||
channelAdapter.setOutputChannel(outputChannel);
|
||||
context.registerEndpoint("testChannel", channelAdapter);
|
||||
context.refresh();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<constructor-arg ref="sourceChannel"/>
|
||||
<constructor-arg ref="serviceActivator"/>
|
||||
<property name="trigger">
|
||||
<bean class="org.springframework.integration.scheduling.IntervalTrigger">
|
||||
<bean class="org.springframework.scheduling.support.PeriodicTrigger">
|
||||
<constructor-arg value="100"/>
|
||||
</bean>
|
||||
</property>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -37,9 +37,9 @@ import org.springframework.integration.handler.AbstractReplyProducingMessageHand
|
||||
import org.springframework.integration.handler.ReplyMessageHolder;
|
||||
import org.springframework.integration.message.MessageBuilder;
|
||||
import org.springframework.integration.message.StringMessage;
|
||||
import org.springframework.integration.scheduling.IntervalTrigger;
|
||||
import org.springframework.integration.util.TestUtils;
|
||||
import org.springframework.integration.util.TestUtils.TestApplicationContext;
|
||||
import org.springframework.scheduling.support.PeriodicTrigger;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
@@ -62,7 +62,7 @@ public class MessageChannelTemplateTests {
|
||||
}
|
||||
};
|
||||
PollingConsumer endpoint = new PollingConsumer(requestChannel, handler);
|
||||
endpoint.setTrigger(new IntervalTrigger(10));
|
||||
endpoint.setTrigger(new PeriodicTrigger(10));
|
||||
context.registerEndpoint("testEndpoint", endpoint);
|
||||
context.refresh();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -33,10 +33,10 @@ import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.core.Message;
|
||||
import org.springframework.integration.message.MessageSource;
|
||||
import org.springframework.integration.message.StringMessage;
|
||||
import org.springframework.integration.scheduling.IntervalTrigger;
|
||||
import org.springframework.integration.scheduling.PollerMetadata;
|
||||
import org.springframework.integration.util.TestUtils;
|
||||
import org.springframework.integration.util.TestUtils.TestApplicationContext;
|
||||
import org.springframework.scheduling.support.PeriodicTrigger;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,7 @@ public class SourcePollingChannelAdapterFactoryBeanTests {
|
||||
return invocation.proceed();
|
||||
}
|
||||
});
|
||||
pollerMetadata.setTrigger(new IntervalTrigger(5000));
|
||||
pollerMetadata.setTrigger(new PeriodicTrigger(5000));
|
||||
pollerMetadata.setMaxMessagesPerPoll(1);
|
||||
pollerMetadata.setAdviceChain(adviceChain);
|
||||
factoryBean.setPollerMetadata(pollerMetadata);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 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.
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.integration.endpoint;
|
||||
|
||||
import org.springframework.integration.scheduling.IntervalTrigger;
|
||||
import org.springframework.scheduling.support.PeriodicTrigger;
|
||||
|
||||
/**
|
||||
* @author Jonas Partner
|
||||
@@ -24,7 +24,7 @@ import org.springframework.integration.scheduling.IntervalTrigger;
|
||||
public class PollingEndpointStub extends AbstractPollingEndpoint {
|
||||
|
||||
public PollingEndpointStub() {
|
||||
this.setTrigger(new IntervalTrigger(500));
|
||||
this.setTrigger(new PeriodicTrigger(500));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,9 +31,9 @@ import org.springframework.integration.core.Message;
|
||||
import org.springframework.integration.core.MessagingException;
|
||||
import org.springframework.integration.endpoint.PollingConsumer;
|
||||
import org.springframework.integration.handler.MethodInvokingMessageHandler;
|
||||
import org.springframework.integration.scheduling.IntervalTrigger;
|
||||
import org.springframework.integration.util.TestUtils;
|
||||
import org.springframework.integration.util.TestUtils.TestApplicationContext;
|
||||
import org.springframework.scheduling.support.PeriodicTrigger;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
@@ -82,7 +82,7 @@ public class MethodInvokingMessageHandlerTests {
|
||||
assertNull(queue.poll());
|
||||
MethodInvokingMessageHandler handler = new MethodInvokingMessageHandler(testBean, "foo");
|
||||
PollingConsumer endpoint = new PollingConsumer(channel, handler);
|
||||
endpoint.setTrigger(new IntervalTrigger(10));
|
||||
endpoint.setTrigger(new PeriodicTrigger(10));
|
||||
context.registerEndpoint("testEndpoint", endpoint);
|
||||
context.refresh();
|
||||
String result = queue.poll(2000, TimeUnit.MILLISECONDS);
|
||||
@@ -100,6 +100,7 @@ public class MethodInvokingMessageHandlerTests {
|
||||
this.queue = queue;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void foo(String s) {
|
||||
try {
|
||||
this.queue.put(s);
|
||||
@@ -111,6 +112,7 @@ public class MethodInvokingMessageHandlerTests {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class TestSink {
|
||||
|
||||
private String result;
|
||||
|
||||
@@ -32,9 +32,9 @@ import org.springframework.integration.context.IntegrationContextUtils;
|
||||
import org.springframework.integration.core.MessageChannel;
|
||||
import org.springframework.integration.endpoint.AbstractEndpoint;
|
||||
import org.springframework.integration.endpoint.AbstractPollingEndpoint;
|
||||
import org.springframework.integration.scheduling.IntervalTrigger;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
import org.springframework.scheduling.support.ErrorHandler;
|
||||
import org.springframework.scheduling.support.PeriodicTrigger;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -137,7 +137,7 @@ public abstract class TestUtils {
|
||||
if (endpoint instanceof AbstractPollingEndpoint) {
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint);
|
||||
if (accessor.getPropertyValue("trigger") == null) {
|
||||
((AbstractPollingEndpoint) endpoint).setTrigger(new IntervalTrigger(10));
|
||||
((AbstractPollingEndpoint) endpoint).setTrigger(new PeriodicTrigger(10));
|
||||
}
|
||||
}
|
||||
registerBean(endpointName, endpoint, this);
|
||||
|
||||
Reference in New Issue
Block a user