From 29900cf4fa78d276fe54d4d114d1f05edd2633e5 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Thu, 16 Sep 2010 18:28:06 -0400 Subject: [PATCH] INT-1380 added quote example --- getting-started/quote/.classpath | 3 + getting-started/quote/.gitignore | 1 + getting-started/quote/pom.xml | 57 +++++++++++------- getting-started/quote/readme.txt | 25 +++++++- .../spring/integration}/quoteDemo.xml | 0 .../samples/quote/QuoteDemoTest.java} | 11 +++- .../{main/java => test/resources}/log4j.xml | 4 +- .../quote/target/classes/log4j.xml | 28 --------- .../integration/samples/quote/Quote.class | Bin 928 -> 0 bytes .../integration/samples/quote/QuoteDemo.class | Bin 618 -> 0 bytes .../samples/quote/QuoteService.class | Bin 1235 -> 0 bytes .../samples/quote/TickerStream.class | Bin 676 -> 0 bytes .../integration/samples/quote/quoteDemo.xml | 27 --------- .../target/maven-archiver/pom.properties | 5 -- .../target/quote-2.0.0.BUILD-SNAPSHOT.jar | Bin 6232 -> 0 bytes 15 files changed, 73 insertions(+), 88 deletions(-) create mode 100644 getting-started/quote/.gitignore rename getting-started/quote/src/main/{java/org/springframework/integration/samples/quote => resources/META-INF/spring/integration}/quoteDemo.xml (100%) rename getting-started/quote/src/{main/java/org/springframework/integration/samples/quote/QuoteDemo.java => test/java/org/springframework/integration/samples/quote/QuoteDemoTest.java} (77%) rename getting-started/quote/src/{main/java => test/resources}/log4j.xml (88%) delete mode 100644 getting-started/quote/target/classes/log4j.xml delete mode 100644 getting-started/quote/target/classes/org/springframework/integration/samples/quote/Quote.class delete mode 100644 getting-started/quote/target/classes/org/springframework/integration/samples/quote/QuoteDemo.class delete mode 100644 getting-started/quote/target/classes/org/springframework/integration/samples/quote/QuoteService.class delete mode 100644 getting-started/quote/target/classes/org/springframework/integration/samples/quote/TickerStream.class delete mode 100644 getting-started/quote/target/classes/org/springframework/integration/samples/quote/quoteDemo.xml delete mode 100644 getting-started/quote/target/maven-archiver/pom.properties delete mode 100644 getting-started/quote/target/quote-2.0.0.BUILD-SNAPSHOT.jar 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 a1f49d21da38b8871654dd33f6058d89d5b90ef4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 928 zcmbVK+iuf95IvKmacWFMO)r#7nnEeLv^5v;LJ$uHAs!+sR1~R?8)utt>q~H)@>?L$ z6oJGC@KK0a+Y+G(FUZn(cITWqbJ?H2zWo637>^9(2v5SO?+gc#3i?Np@a4xaI(1YK z%YGzc6$Z{w_ybQ4oe!fhmd-nE4HO91PQ;mTJQ4Jr{qBi$V?r@j?x~CjcKc88AlA8C zggF**C1E8E`XWAd_Ei6sbd@hW1{9yGK*cWz&Du17HmTkr6kdisX(ErS7Ur=)$k*zf zd2odm=1|n0ZNWf^P;RS0z8(2p8NC->kBhO}p)0(Oh?G8OmxcIP4GB-%|1lfxqZEf} z(}bm3eYzC`HwmkkC$u+GUQb3QZlhx0&R+vg(^*(Ym0+9+ZzT7R2wRhLN|(@@p=V+Z zclB)U5tb(@*=p*Y67Can&#D^vz(Ngm-i8zicm zT3E#mf_V^*B3HgvdPipR=yvtMu)*8R^YhK|$IDGTUTyLxZqelU6+RtuT;s}(3s{Zj zIXm0uSp1v-ud}sLU|V6k&a^5PIQ0_WR8tz3vBD=#kjPNtX`vhoaEY1B8%FC`-K^PE`?ov^3jP3p zlsIX{3VQPLCNr75dGqrA@$v>>8!LHa7Ru3{?#BdpRfPeqi3 zGUfMOZ6!Z*cqk*CM~J2*U;C}Ll%W`j9`>u zs;Odm+>P4OT!?lk8OlxVi?Ah(a`{&=XKz)?P;35EUY$lqLd6X8m8<4Z=DBs7)~l^N zrWp?YV)r#|-?KdJCW$tdH$su7r^4P|M&W*vgv#$5(-^dkVTNI%Z;rENs~3eHN|dq>2s4BQY%bA3(x!^mccvMUE|9m<@}ob{(~*I7uG>$(~klfI+4kQdCE9N zMsZ~G8DmfVYmd-f1FI+!jt?3rPEc0BB&Mk19@mJ{^%Y-HDwoUb8M8wQk0t?Y@M!js PricYBQk`LmFoWe!Co!4N 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 9159c6a57da6f9e809d25fb7f50a5c45703f1b93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1235 zcmbVLYflqF6g^XDmzJV{SiuL%Lumn70iP6&NFkCGjMOygCo^ovGIV#Q?#`k=OZ`9- zN&Er+DC6BNN)s^}_QTAbojd2AnRD*mq|5q_apO#c;7KmDmZrJ>kFMd#+#@E^CLoRqo4Zee$!{?8|^*wS0btMTUM? z>t@)Bc{6O~%cp!RCc1U8aGnB$JhmGuBRx@-fh5*zN@){68IgYaPfY$h-9CBFHOI(9 zZnRI>S*co~S>LBD;WAi8I!)md@PH0Y_f9I7C9rUXVI;nq$IZU|LN-dmksfy~jQtWR zG}5(qxvFa~gHfcT;d&M~FwT%s;-e|)FqVUKE2W;-$R+e;ki%r8+!RTfFBPg5ZZj;O zLzFaTP_U3^$el9X)uF1B4BKRqEM_sskbb#V-h8`J-PmCm?dTO>synq9(Yl+(0&Ir9 zK$r>{h@7;T-}>8$Lf6LW`w-AH7Nh$uG0dG|kF!rj#!huqiR}A_sTh*fQw}l8oee-w zUeTfNh)o&s9_ntag$V9{oZn@lZ4m^#AvRRKrKx?3m;g0ktYCs7YCIY(TH7=;nv=6_ z^nIovK@ub02FB4(aki5{^8l?FF5n_%4N^Qvt09Vq16;yLfXgwYq|;HUnPcQ?#~7`( zarFq-MsTy)#>Dn9rfYNa$uGEbg!wk^eWKJ((G1PNBuP0H7rxbjIVntlSjK%SnWLf) T@Q|_-cod(09Mg&J^aS_`5v@(5 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 82469942ca5dfb67e15b83f79637972ef151516a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 676 zcmbVJ%Wl&^6g}hk(U_FFrLWM0w$Me=s>V#9;Qa4%QAa5zvh>%CMw z6>oCY4`rrBPjM~tEFAK5kceUUYLsgc?#s9@R7WepQx7&naLQlvFyUD*eA+z~v1V}h zWG3|khEk(>z+kuXW8tHOas>`thM7oa;>jrO3boI>iC~zE@|Y(FTuGB(9@_du4jJ~M z|5v!n;Ai4YPgFC^H=5C3z2t&i?|PWMvN6&!37_%oI8S{9C>xlsU;&E^o*`;yDlHNAMbVu{J|CkR7vmWZCw3Cli zEFMX-k=cJ2y<;?E9kfxpIl!VX+9aVzSxAvlbT-GB`c#yCLQ@8oagDGt`GMjzWenFb zLui`c!Y)X+-LFnmy8i*yt=a{G!!hQ9>Sx>t9=>?@{M=$S_x - - - - - - - - - - - - - - - - - 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 6cbe6fb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