diff options
| author | BMatajsz <90217645+BMatajsz@users.noreply.github.com> | 2024-12-03 10:27:54 -0500 |
|---|---|---|
| committer | BMatajsz <90217645+BMatajsz@users.noreply.github.com> | 2024-12-03 10:27:54 -0500 |
| commit | 298eb839a8ccdd625978cf51476a6c412d11902b (patch) | |
| tree | 99571b2234f546b6a5b536d27dac086d1ec99433 /src/main/java/derms/replica1/DERMSServerPublisher.java | |
| parent | d0b0b50f18c4713814c565af2f3146ec82aa6b0f (diff) | |
| parent | 1a2c519e5e70cc1e31eaef5cd770da75d75d6654 (diff) | |
| download | soen423-298eb839a8ccdd625978cf51476a6c412d11902b.zip | |
Merge branch 'test' of https://github.com/sam-rba/soen423 into test
Diffstat (limited to 'src/main/java/derms/replica1/DERMSServerPublisher.java')
| -rw-r--r-- | src/main/java/derms/replica1/DERMSServerPublisher.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/main/java/derms/replica1/DERMSServerPublisher.java b/src/main/java/derms/replica1/DERMSServerPublisher.java index 9b5ba91..442f844 100644 --- a/src/main/java/derms/replica1/DERMSServerPublisher.java +++ b/src/main/java/derms/replica1/DERMSServerPublisher.java @@ -2,22 +2,26 @@ package derms.replica1; import javax.xml.ws.Endpoint;
-import derms.frontend.DERMSServerImpl;
-
public class DERMSServerPublisher {
- private static Endpoint endpoint;
+ private static Endpoint[] endpoints = new Endpoint[3];
public static void main(String[] args) {
- // Publish the web service
- endpoint = Endpoint.publish("http://127.0.0.1:8387/ws/derms", new DERMSServerImpl());
- System.out.println("DERMS Server is published at http://127.0.0.1:8387/ws/derms");
+ try {
+ endpoints[0] = Endpoint.publish("http://localhost:8387/ws/derms", new DERMSServer("MTL"));
+ endpoints[1] = Endpoint.publish("http://localhost:8081/ws/derms", new DERMSServer("QUE"));
+ endpoints[3] = Endpoint.publish("http://localhost:8082/ws/derms", new DERMSServer("SHE"));
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
}
public static void stop() {
- if (endpoint != null && endpoint.isPublished()) {
- endpoint.stop();
- System.out.println("DERMS Server is stopped.");
+ for (Endpoint endpoint : endpoints) {
+ if (endpoint != null && endpoint.isPublished()) {
+ endpoint.stop();
+ System.out.println("DERMS Server is stopped.");
+ }
}
}
}
\ No newline at end of file |