context.load("classpath:META-INF/spring/integration/*-context.xml");
context.registerShutdownHook();
context.refresh();
final ConnectionBroker connectionBroker = context.getBean(ConnectionBroker.class);
if (LOGGER.isInfoEnabled()) {
LOGGER.info("\n========================================================="
+ "\n "
+ "\n Please press 'q + Enter' to quit the application. "
+ "\n For statistical information press 'i + Enter'. "
+ "\n "
+ "\n In your browser open: "
+ "\n file:///.../src/main/webapp/index.html "
+ "\n=========================================================" );
}
while (true) {
final String input = scanner.nextLine();
if("q".equals(input.trim())) {
break;
}
else if("i".equals(input.trim())) {
LOGGER.info("\n========================================================="
+ "\n "
+ "\n Number of connected clients: " + connectionBroker.connectedClients()
+ "\n "
+ "\n=========================================================" );
}
}