1 package at.ac.tuwien.sbc.valesriegler.waiter;
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
6 import at.ac.tuwien.sbc.valesriegler.waiter.jms.JMSWaiter;
9 * A waiter is a person who does all the stuff and gets lousy tips in return.
10 * The WaiterAgent runs the XVSM/JMSWaiter to do all the Waiter stuff.
15 public class WaiterAgent {
16 private static final String USAGE = "This application needs exactly 2 parameters: <\"XVSM\"|\"JMS\"> <ID of type Integer>";
17 private static final Logger log = LoggerFactory.getLogger(WaiterAgent.class);
19 public static void main(String[] args) {
20 if (args.length != 2) {
21 throw new IllegalArgumentException(USAGE);
27 parsedId = Integer.parseInt(args[1]);
28 } catch (NumberFormatException e) {
33 log.info("Middleware: " + mw + " ID:" + parsedId);
34 if ("JMS".equalsIgnoreCase(mw)) {
35 new JMSWaiter(parsedId);
36 } else if ("XVSM".equalsIgnoreCase(mw)) {
39 throw new IllegalArgumentException(USAGE);