diff --git a/spring-integration-samples/.classpath b/spring-integration-samples/.classpath
index 009e67c417..33d4ccf93f 100644
--- a/spring-integration-samples/.classpath
+++ b/spring-integration-samples/.classpath
@@ -15,5 +15,6 @@
+
diff --git a/spring-integration-samples/ivy.xml b/spring-integration-samples/ivy.xml
index b4ce6dd341..4311e00e53 100644
--- a/spring-integration-samples/ivy.xml
+++ b/spring-integration-samples/ivy.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/Counter.java b/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/Counter.java
new file mode 100644
index 0000000000..c710a8b7ed
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/Counter.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2002-2007 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.integration.samples.oddeven;
+
+import org.springframework.integration.endpoint.annotation.MessageEndpoint;
+import org.springframework.integration.endpoint.annotation.Polled;
+import org.springframework.integration.handler.annotation.Router;
+
+/**
+ * @author Mark Fisher
+ */
+@MessageEndpoint
+public class Counter {
+
+ private volatile int count = 1;
+
+ @Polled(period=3000)
+ public int getNumber() {
+ return count++;
+ }
+
+ @Router
+ public String resolveChannel(int i) {
+ if (i % 2 == 0) {
+ return "even";
+ }
+ return "odd";
+ }
+
+}
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/NumberLogger.java b/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/NumberLogger.java
new file mode 100644
index 0000000000..4475fe22f9
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/NumberLogger.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2002-2007 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.integration.samples.oddeven;
+
+import org.springframework.integration.endpoint.annotation.Subscriber;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author Mark Fisher
+ */
+@Component
+public class NumberLogger {
+
+ @Subscriber(channel="even")
+ public void even(int i) {
+ System.out.println("even: " + i);
+ }
+
+ @Subscriber(channel="odd")
+ public void odd(int i) {
+ System.out.println("odd: " + i);
+ }
+
+}
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/OddEvenDemo.java b/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/OddEvenDemo.java
new file mode 100644
index 0000000000..a490f5f71c
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/OddEvenDemo.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2002-2007 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.integration.samples.oddeven;
+
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @author Mark Fisher
+ */
+public class OddEvenDemo {
+
+ public static void main(String[] args) throws Exception {
+ AbstractApplicationContext context = new ClassPathXmlApplicationContext("oddEvenDemo.xml", OddEvenDemo.class);
+ context.start();
+ System.in.read();
+ }
+
+}
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/oddEvenDemo.xml b/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/oddEvenDemo.xml
new file mode 100644
index 0000000000..bd899a335d
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/oddeven/oddEvenDemo.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/Quote.java b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/Quote.java
new file mode 100644
index 0000000000..f655f02cf6
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/Quote.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2002-2007 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.integration.samples.quote;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Mark Fisher
+ */
+public class Quote {
+
+ private String ticker;
+
+ private BigDecimal price;
+
+ public Quote(String ticker, BigDecimal price) {
+ this.ticker = ticker;
+ this.price = price;
+ }
+
+ public String toString() {
+ return ticker + ": " + price;
+ }
+
+}
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuoteDemo.java b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuoteDemo.java
new file mode 100644
index 0000000000..e48bd03bd5
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuoteDemo.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2002-2007 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.integration.samples.quote;
+
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @author Mark Fisher
+ */
+public class QuoteDemo {
+
+ public static void main(String[] args) throws Exception {
+ AbstractApplicationContext context = new ClassPathXmlApplicationContext("quoteDemo.xml", QuoteDemo.class);
+ context.start();
+ System.in.read();
+ }
+}
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuotePublisher.java b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuotePublisher.java
new file mode 100644
index 0000000000..ded1769972
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuotePublisher.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2002-2007 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.integration.samples.quote;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Random;
+
+import org.springframework.integration.endpoint.annotation.MessageEndpoint;
+import org.springframework.integration.endpoint.annotation.Polled;
+
+/**
+ * @author Mark Fisher
+ */
+@MessageEndpoint(defaultOutput="quotes")
+public class QuotePublisher {
+
+ @Polled(period=300)
+ public Quote getQuote() {
+ BigDecimal price = new BigDecimal(new Random().nextDouble() * 100);
+ return new Quote("SOA", price.setScale(2, RoundingMode.HALF_EVEN));
+ }
+
+}
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuoteSubscriber.java b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuoteSubscriber.java
new file mode 100644
index 0000000000..cf7456b4bd
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/QuoteSubscriber.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2002-2007 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.integration.samples.quote;
+
+import org.springframework.integration.endpoint.annotation.Subscriber;
+
+/**
+ * @author Mark Fisher
+ */
+public class QuoteSubscriber {
+
+ @Subscriber(channel="quotes")
+ public void log(Object o) {
+ System.out.println(o);
+ }
+
+}
diff --git a/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/quoteDemo.xml b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/quoteDemo.xml
new file mode 100644
index 0000000000..cf66173db8
--- /dev/null
+++ b/spring-integration-samples/src/main/java/org/springframework/integration/samples/quote/quoteDemo.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+