INTSAMPLES-55 - Update README.md for OddEven Sample

For reference: https://jira.springsource.org/browse/INTSAMPLES-55

* Update README.md to reflect correct classes
* Improve documentation
* Add Maven Exec Maven Plugin for easy execution from the command line
This commit is contained in:
Gunnar Hillert
2012-02-10 15:39:39 -05:00
parent 9d14c3f0b2
commit aae6038794
8 changed files with 133 additions and 79 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 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.
@@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* Adapter acting as a Polling Consumer.
* <p/>
* Every 5th number will be returned as a negative value.
*
*
* @author Mark Fisher
*/
public class Counter {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 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.
@@ -29,7 +29,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
* <p>
* See the 'cronOddEvenDemo.xml' configuration file for more detail. The cron
* expression is based on the Fibonacci sequence. Feel free to modify it.
*
*
* @author Mark Fisher
*/
public class CronOddEvenDemo {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 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.
@@ -25,14 +25,14 @@ import org.springframework.integration.annotation.ServiceActivator;
/**
* A POJO Service Activator that logs even numbers and the current time.
*
*
* @author Mark Fisher
* @author Marius Bogoevici
*/
@MessageEndpoint
public class EvenLogger {
private static Logger logger = Logger.getLogger(EvenLogger.class);
@ServiceActivator
public void log(int i) {
logger.info("even: " + i + " at " + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 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.
@@ -13,22 +13,19 @@
* 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.ClassPathXmlApplicationContext;
/**
* Demonstrates a method-invoking inbound Channel Adapter acting as a Polling
* Demonstrates a method-invoking Inbound Channel Adapter acting as a Polling
* Consumer with an interval-based trigger. That adapter is followed,
* downstream, by a simple method-invoking Message Filter that discards
* negative numbers to the "nullChannel". Next is a Content Based Router. The
* router sends to one of two channels based on whether the payload number is
* odd or even. Each of those two channels has an Event Driven Consumer ready
* to log the number and the current time.
* downstream, by a Content Based Router. The router sends to one of two channels,
* based on whether the payload number is odd or even. Each of those two channels
* has an Event Driven Consumer ready to log the number and the current time.
* <p>
* See the 'intervalOddEvenDemo.xml' configuration file for more detail.
*
*
* @author Mark Fisher
*/
public class IntervalOddEvenDemoTestApp {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 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.
@@ -25,7 +25,7 @@ import org.springframework.integration.annotation.ServiceActivator;
/**
* A POJO Service Activator that logs odd numbers and the current time.
*
*
* @author Mark Fisher
* @author Marius Bogoevici
*/
@@ -35,7 +35,7 @@ public class OddLogger {
@ServiceActivator
public void log(int i) {
logger.info("odd: " + i + " at " + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
logger.info("odd: " + i + " at " + new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
}
}

View File

@@ -5,7 +5,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
http://www.springframework.org/schema/integration/spring-integration-2.1.xsd">
<annotation-config/>