-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDSMSServer.java
53 lines (42 loc) · 1.73 KB
/
DSMSServer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package a3;
import javax.xml.ws.Endpoint;
public class DSMSServer {
public static void main(String args[]) {
try{
Runnable QCServer = () -> {
System.out.println("QCServer Started...");
DSMSImpl impl = new DSMSImpl("QC");
impl.inventory.put("QC1000", new Item("QC1000", "Das Kapital", 0, 25.00));
impl.inventory.put("QC2000", new Item("QC2000", "Avengers Infinity War", 10, 20.00));
impl.inventory.put("QC3000", new Item("QC3000", "Cosmos", 2, 17.50));
Endpoint endpoint = Endpoint.publish("http://localhost:8080/a3/WebInterfaceQC", impl);
};
Runnable ONServer = () -> {
System.out.println("ONServer Started...");
DSMSImpl impl = new DSMSImpl("ON");
impl.inventory.put("ON1000", new Item("ON1000", "Shirt", 20, 1000.01));
impl.inventory.put("ON2000", new Item("ON2000", "Tank top", 10, 8.00));
impl.inventory.put("ON3000", new Item("ON3000", "Socks", 5, 5.50));
Endpoint endpoint = Endpoint.publish("http://localhost:8080/a3/WebInterfaceON", impl);
};
Runnable BCServer = () -> {
System.out.println("BCServer Started...");
DSMSImpl impl = new DSMSImpl("BC");
impl.inventory.put("BC1000", new Item("BC1000", "Barbell", 0, 100.00));
impl.inventory.put("BC2000", new Item("BC2000", "Dumbbells", 2, 34.00));
impl.inventory.put("BC3000", new Item("BC3000", "Kettlebells", 1, 50.00));
Endpoint endpoint = Endpoint.publish("http://localhost:8080/a3/WebInterfaceBC", impl);
};
Thread thread = new Thread(QCServer);
Thread thread2 = new Thread(ONServer);
Thread thread3 = new Thread(BCServer);
thread.start();
thread2.start();
thread3.start();
}
catch (Exception e) {
System.err.println("ERROR: " + e);
e.printStackTrace(System.out);
}
}
}