diff options
Diffstat (limited to 'src/main/java/derms/replica1/DERMSServerPublisher.java')
| -rw-r--r-- | src/main/java/derms/replica1/DERMSServerPublisher.java | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/derms/replica1/DERMSServerPublisher.java b/src/main/java/derms/replica1/DERMSServerPublisher.java index 3edf16c..442f844 100644 --- a/src/main/java/derms/replica1/DERMSServerPublisher.java +++ b/src/main/java/derms/replica1/DERMSServerPublisher.java @@ -3,14 +3,25 @@ package derms.replica1; import javax.xml.ws.Endpoint;
public class DERMSServerPublisher {
+
+ private static Endpoint[] endpoints = new Endpoint[3];
+
public static void main(String[] args) {
try {
- Endpoint.publish("http://localhost:8387/ws/derms", new DERMSServer("MTL"));
- Endpoint.publish("http://localhost:8081/ws/derms", new DERMSServer("QUE"));
- Endpoint.publish("http://localhost:8082/ws/derms", new DERMSServer("SHE"));
+ 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);
}
- System.out.println("DERMS Web Service is published at http://localhost:8387/ws/derms");
+ }
+
+ public static void stop() {
+ for (Endpoint endpoint : endpoints) {
+ if (endpoint != null && endpoint.isPublished()) {
+ endpoint.stop();
+ System.out.println("DERMS Server is stopped.");
+ }
+ }
}
}
\ No newline at end of file |