]> git.somenet.org - pub/jan/sbc.git/blob - src/main/java/at/ac/tuwien/sbc/valesriegler/xvsm/cook/Cook.java
Space waiters pay and overall remaining space workflow refactoring
[pub/jan/sbc.git] / src / main / java / at / ac / tuwien / sbc / valesriegler / xvsm / cook / Cook.java
1 package at.ac.tuwien.sbc.valesriegler.xvsm.cook;
2
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5
6 import at.ac.tuwien.sbc.valesriegler.xvsm.CookXVSM;
7
8 public class Cook {
9         private static final String USAGE = "Cook needs exactly one parameter: ID of type Integer";
10         private static final Logger log = LoggerFactory.getLogger(Cook.class);
11         
12         private int id;
13         private CookXVSM xvsm;
14
15         public static void main(String[] args) {
16                 if(args.length != 1) {
17                         throw new IllegalArgumentException(USAGE);
18                 }
19                 
20                 int parsedId = 0;
21                 try {
22                         parsedId = Integer.parseInt(args[0]);
23                 } catch (NumberFormatException e) {
24                         log.error(USAGE);
25                         return;
26                 }
27                 
28                 Cook cook = new Cook(parsedId);
29                 cook.start();
30         }
31
32         private void start() {
33                 xvsm = new CookXVSM(id);
34                 
35                 xvsm.listenForPizzas();
36                 
37                 
38         }
39
40         public Cook(int id) {
41                 this.id = id;
42                 log.info("I AM A Cook WITH ID {}", id);
43         }
44
45 }