KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > systest > schema_validation > ValidationServer


1 package org.objectweb.celtix.systest.schema_validation;
2
3 import java.net.URL JavaDoc;
4
5 import javax.xml.ws.Endpoint;
6
7 import org.objectweb.celtix.systest.common.TestServerBase;
8
9 public class ValidationServer extends TestServerBase {
10     
11     private String JavaDoc oldConfig;
12     
13     public ValidationServer() {
14         oldConfig = System.getProperty("celtix.config.file");
15         URL JavaDoc url = getClass().getResource("celtix-config.xml");
16         if (url != null) {
17             System.setProperty("celtix.config.file", url.toString());
18         }
19     }
20     
21     protected void run() {
22         Object JavaDoc implementor = new SchemaValidationImpl();
23         String JavaDoc address = "http://localhost:9900/SoapContext/SoapPort";
24         Endpoint.publish(address, implementor);
25     }
26     
27     public boolean stopInProcess() throws Exception JavaDoc {
28         System.setProperty("celtix.config.file", oldConfig);
29         return super.stopInProcess();
30     }
31
32     public static void main(String JavaDoc[] args) {
33         try {
34             ValidationServer s = new ValidationServer();
35             s.start();
36         } catch (Exception JavaDoc ex) {
37             ex.printStackTrace();
38             System.exit(-1);
39         } finally {
40             System.out.println("done!");
41         }
42     }
43 }
44
Popular Tags