Removed the @MessageSource method-level annotation and added @Pollable as its replacement. Also added the @ChannelAdapter class-level annotation (refactoring to remove SourceEndpoint).

This commit is contained in:
Mark Fisher
2008-08-05 20:02:52 +00:00
parent bbd7a12a4e
commit 8274dfc428
10 changed files with 105 additions and 92 deletions

View File

@@ -22,11 +22,13 @@ import java.util.Random;
import org.springframework.integration.annotation.Handler;
import org.springframework.integration.annotation.MessageEndpoint;
import org.springframework.integration.annotation.Polled;
/**
* @author Mark Fisher
*/
@MessageEndpoint(input="tickers", output="quotes")
@Polled(period=300)
public class QuoteService {
@Handler

View File

@@ -18,18 +18,16 @@ package org.springframework.integration.samples.quote;
import java.util.Random;
import org.springframework.integration.annotation.MessageEndpoint;
import org.springframework.integration.annotation.MessageSource;
import org.springframework.integration.annotation.Polled;
import org.springframework.integration.annotation.ChannelAdapter;
import org.springframework.integration.annotation.Pollable;
/**
* @author Mark Fisher
*/
@MessageEndpoint(output="tickers")
@Polled(period=300)
@ChannelAdapter("tickers")
public class TickerStream {
@MessageSource
@Pollable
public String nextTicker() {
char[] chars = new char[3];
for (int i = 0; i < 3; i++) {

View File

@@ -11,8 +11,6 @@
<annotation-driven/>
<channel id="tickers"/>
<beans:bean class="org.springframework.integration.samples.quote.TickerStream"/>
<beans:bean class="org.springframework.integration.samples.quote.QuoteService"/>