1 package at.ac.tuwien.sbc.valesriegler.cook;
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
6 import at.ac.tuwien.sbc.valesriegler.cook.jms.JMSCook;
9 * CookAgent parses the arguments and runs the JMS/XVSMCook with the given ID.
14 public class CookAgent {
15 private static final String USAGE = "This application needs exactly 2 parameters: <\"XVSM\"|\"JMS\"> <ID of type Integer>";
16 private static final Logger log = LoggerFactory.getLogger(CookAgent.class);
18 public static void main(String[] args) throws Exception {
19 if (args.length != 2) {
20 throw new IllegalArgumentException(USAGE);
26 parsedId = Integer.parseInt(args[1]);
27 } catch (NumberFormatException e) {
32 log.info("Middleware: " + mw + " ID:" + parsedId);
33 if ("JMS".equalsIgnoreCase(mw)) {
34 new JMSCook(parsedId);
35 } else if ("XVSM".equalsIgnoreCase(mw)) {
38 throw new IllegalArgumentException(USAGE);