diff --git a/getting-started/quote/.classpath b/getting-started/quote/.classpath index 24166ba5..0ce7eaab 100644 --- a/getting-started/quote/.classpath +++ b/getting-started/quote/.classpath @@ -1,6 +1,9 @@ + + + diff --git a/getting-started/quote/.gitignore b/getting-started/quote/.gitignore new file mode 100644 index 00000000..ea8c4bf7 --- /dev/null +++ b/getting-started/quote/.gitignore @@ -0,0 +1 @@ +/target diff --git a/getting-started/quote/pom.xml b/getting-started/quote/pom.xml index 488e3cac..4fa6ed7f 100644 --- a/getting-started/quote/pom.xml +++ b/getting-started/quote/pom.xml @@ -2,34 +2,47 @@ 4.0.0 - - org.springframework.integration.samples - spring-integration-samples - 2.0.0.BUILD-SNAPSHOT - + org.springframework.integration.samples quote Spring Integration Quote Sample + 2.0.0 + jar + + 2.0.0.M7 + 1.2.15 + 4.7 + org.springframework.integration spring-integration-stream + ${spring.integration.version} + + + log4j + log4j + ${log4j.version} + + + + junit + junit + ${junit.version} - - - repository.springframework.maven.release - Spring Framework Maven Release Repository - http://maven.springframework.org/release - - - repository.springframework.maven.milestone - Spring Framework Maven Milestone Repository - http://maven.springframework.org/milestone - - - repository.springframework.maven.snapshot - Spring Framework Maven Snapshot Repository - http://maven.springframework.org/snapshot - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + -Xlint:all + true + false + + + + diff --git a/getting-started/quote/readme.txt b/getting-started/quote/readme.txt index 7a5970da..3d19635e 100644 --- a/getting-started/quote/readme.txt +++ b/getting-started/quote/readme.txt @@ -1 +1,24 @@ -Demonstrates stream channel adapter and poller \ No newline at end of file +This example demonstrates the following aspects of the CORE EIP support available with Spring Integration: +1. Channel Adapter (Inbound and Stdout) +2. Poller with Interval Trigers +3. Service Activator + +A very simple example that introduces you to the Channel adapters and Pollers. + +Messages are simply being emitted by the Poller (interval based) triggering 'nextTicker()' method of TickerStream class and +sent to a 'tickers' channel from which they are retrieved by the TickerStream service. TockerStream service generates random +ticker symbols sending them to the 'quotes' channel from which they are retrieved by the QuoteService (annotation based Service Activator). +QuoteService generates random quotes sending them to the Stdout Channel Adapter where they are printed to a console. + +To execute sample simply run QuoteDemoTest. You should see the output similar to this: +XNY: 90.03 +XMR: 17.11 +IWR: 35.85 +KHR: 54.43 +WUW: 95.29 +YYC: 7.44 +DYW: 84.76 +TIW: 28.31 +HGE: 28.90 + + diff --git a/getting-started/quote/src/main/java/org/springframework/integration/samples/quote/quoteDemo.xml b/getting-started/quote/src/main/resources/META-INF/spring/integration/quoteDemo.xml similarity index 100% rename from getting-started/quote/src/main/java/org/springframework/integration/samples/quote/quoteDemo.xml rename to getting-started/quote/src/main/resources/META-INF/spring/integration/quoteDemo.xml diff --git a/getting-started/quote/src/main/java/org/springframework/integration/samples/quote/QuoteDemo.java b/getting-started/quote/src/test/java/org/springframework/integration/samples/quote/QuoteDemoTest.java similarity index 77% rename from getting-started/quote/src/main/java/org/springframework/integration/samples/quote/QuoteDemo.java rename to getting-started/quote/src/test/java/org/springframework/integration/samples/quote/QuoteDemoTest.java index c868dfc5..ba03eba5 100644 --- a/getting-started/quote/src/main/java/org/springframework/integration/samples/quote/QuoteDemo.java +++ b/getting-started/quote/src/test/java/org/springframework/integration/samples/quote/QuoteDemoTest.java @@ -16,6 +16,7 @@ package org.springframework.integration.samples.quote; +import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; /** @@ -26,9 +27,13 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; * * @author Mark Fisher */ -public class QuoteDemo { +public class QuoteDemoTest { - public static void main(String[] args) { - new ClassPathXmlApplicationContext("quoteDemo.xml", QuoteDemo.class); + @Test + public void testDemo() throws Exception{ + ClassPathXmlApplicationContext context = + new ClassPathXmlApplicationContext("/META-INF/spring/integration/quoteDemo.xml", QuoteDemoTest.class); + Thread.sleep(5000); + context.close(); } } diff --git a/getting-started/quote/src/main/java/log4j.xml b/getting-started/quote/src/test/resources/log4j.xml similarity index 88% rename from getting-started/quote/src/main/java/log4j.xml rename to getting-started/quote/src/test/resources/log4j.xml index 3865c97d..f391e2ed 100644 --- a/getting-started/quote/src/main/java/log4j.xml +++ b/getting-started/quote/src/test/resources/log4j.xml @@ -15,8 +15,8 @@ - - + + diff --git a/getting-started/quote/target/classes/log4j.xml b/getting-started/quote/target/classes/log4j.xml deleted file mode 100644 index 3865c97d..00000000 --- a/getting-started/quote/target/classes/log4j.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/Quote.class b/getting-started/quote/target/classes/org/springframework/integration/samples/quote/Quote.class deleted file mode 100644 index a1f49d21..00000000 Binary files a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/Quote.class and /dev/null differ diff --git a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/QuoteDemo.class b/getting-started/quote/target/classes/org/springframework/integration/samples/quote/QuoteDemo.class deleted file mode 100644 index 50fe871d..00000000 Binary files a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/QuoteDemo.class and /dev/null differ diff --git a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/QuoteService.class b/getting-started/quote/target/classes/org/springframework/integration/samples/quote/QuoteService.class deleted file mode 100644 index 9159c6a5..00000000 Binary files a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/QuoteService.class and /dev/null differ diff --git a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/TickerStream.class b/getting-started/quote/target/classes/org/springframework/integration/samples/quote/TickerStream.class deleted file mode 100644 index 82469942..00000000 Binary files a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/TickerStream.class and /dev/null differ diff --git a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/quoteDemo.xml b/getting-started/quote/target/classes/org/springframework/integration/samples/quote/quoteDemo.xml deleted file mode 100644 index 25c335e6..00000000 --- a/getting-started/quote/target/classes/org/springframework/integration/samples/quote/quoteDemo.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/getting-started/quote/target/maven-archiver/pom.properties b/getting-started/quote/target/maven-archiver/pom.properties deleted file mode 100644 index a92bde97..00000000 --- a/getting-started/quote/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Sat Sep 04 08:22:31 EDT 2010 -version=2.0.0.BUILD-SNAPSHOT -groupId=org.springframework.integration.samples -artifactId=quote diff --git a/getting-started/quote/target/quote-2.0.0.BUILD-SNAPSHOT.jar b/getting-started/quote/target/quote-2.0.0.BUILD-SNAPSHOT.jar deleted file mode 100644 index 6cbe6fba..00000000 Binary files a/getting-started/quote/target/quote-2.0.0.BUILD-SNAPSHOT.jar and /dev/null differ