final GenericXmlApplicationContext context = new GenericXmlApplicationContext();
context.load("classpath:META-INF/spring/integration/spring-integration-sample1-context.xml");
context.registerShutdownHook();
context.refresh();
final StringConversionService service = context.getBean(StringConversionService.class);
final String message =
"\n========================================================="
+ "\n "
+ "\n Please press 'q + Enter' to quit the application. "
+ "\n "
+ "\n========================================================="
+ "\n\n Please enter a string and press <enter>: ";
System.out.print(message);
while (!scanner.hasNext("q")) {
String input = scanner.nextLine();
System.out.println("Converting String to Uppcase using Stored Procedure...");
String inputUpperCase = service.convertToUpperCase(input);
System.out.println("Retrieving Numeric value via Sql Function...");
Integer number = service.getNumber();
System.out.println(String.format("Converted '%s' - End Result: '%s_%s'.", input, inputUpperCase, number));
System.out.print("To try again, please enter a string and press <enter>:");
}