INTSAMPLES-122: Migrate to Gradle

JIRA: https://jira.springsource.org/browse/INTSAMPLES-122

INTSAMPLES-122: Polishing

INTSAMPLES-122: Add generated poms

* Upgrade some dependencies

INTSAMPLES-122: Cover Java/DSL sample

INTSAMPLES-122: Upgrade to SI 4.0.1 & SF 4.0.5

INTSAMPLES-122: Polishing according PR comments

Make gradlew executable
This commit is contained in:
Artem Bilan
2014-05-20 17:47:20 +03:00
committed by Gary Russell
parent 148e7b52c2
commit ea3ba21249
119 changed files with 7683 additions and 5363 deletions

View File

@@ -20,56 +20,55 @@ import java.util.Arrays;
import java.util.List;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.util.StringUtils;
/**
* An implementation of the Cafe Demo application to demonstrate Spring Integration's
* scripting capability. This process expects a command line argument corresponding to the scripting language
* to use.
*
* to use.
*
* Provides the 'main' method for running the Cafe Demo application. When an
* order is placed, the Cafe will send that order to the "orders" channel.
* The relevant components are defined within the configuration file
* ("cafeDemo.xml").
*
*
* @author Mark Fisher
* @author Marius Bogoevici
* @author Oleg Zhurakousky
* @author David Turanski
*/
public class CafeDemoApp {
public static void main(String[] args) {
List<String> languages = Arrays.asList(new String[]{"groovy","ruby","javascript","python"});
if (args.length != 1) {
usage();
}
String lang = args[0];
if (!StringUtils.hasText(lang)){
usage();
}
lang = lang.toLowerCase();
if (!languages.contains(lang)){
usage();
}
/*
* Create an application context and set the active profile to configure the
* Create an application context and set the active profile to configure the
* corresponding scripting implementation
*/
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext();
((ConfigurableEnvironment)ctx.getEnvironment()).setActiveProfiles(lang);
ctx.getEnvironment().setActiveProfiles(lang);
ctx.setConfigLocation("/META-INF/spring/integration/cafeDemo.xml");
ctx.refresh();
}
private static void usage() {
System.out.println("missing or invalid commannd line argument [groovy,ruby,javascript,python]");
System.exit(1);