KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > systest > securebasic > WantAndNeedClientAuthServer


1 package org.objectweb.celtix.systest.securebasic;
2
3 import javax.xml.ws.Endpoint;
4
5 import org.objectweb.celtix.systest.common.TestServerBase;
6
7
8
9 public class WantAndNeedClientAuthServer extends TestServerBase {
10     private static boolean launchingServer;
11     
12     
13     private String JavaDoc url;
14     
15     public WantAndNeedClientAuthServer(String JavaDoc urlParam) {
16         String JavaDoc configFile = getClass().getResource(".") + "WantAndNeedClientAuthServer.xml";
17         System.setProperty("celtix.config.file", configFile);
18         url = urlParam;
19     }
20     
21     protected void run() {
22         Object JavaDoc implementor = new GreeterImpl();
23         String JavaDoc address = url;
24         Endpoint.publish(address, implementor);
25         launchingServer = false;
26     }
27     
28
29     public static void main(String JavaDoc[] args) {
30         
31         try {
32             WantAndNeedClientAuthServer requireClientAuth =
33                 new WantAndNeedClientAuthServer("https://localhost:9001/SoapContext/SoapPort");
34
35
36             ServerThread st1 = new ServerThread(requireClientAuth);
37             launchingServer = true;
38             st1.start();
39             
40             while (launchingServer) {
41                 Thread.sleep(2000);
42             }
43             WantAndNeedClientAuthServer requireClientAuthDiffernetCiphersuite =
44                 new WantAndNeedClientAuthServer("https://localhost:9011/SoapContext/SoapPort");
45             ServerThread st2 = new ServerThread(requireClientAuthDiffernetCiphersuite);
46             st2.start();
47         } catch (Exception JavaDoc ex) {
48             ex.printStackTrace();
49             System.exit(-1);
50         } finally {
51             System.out.println("done!");
52         }
53     }
54 }
55
56 class ServerThread extends Thread JavaDoc {
57     TestServerBase server;
58     public ServerThread(TestServerBase t) {
59         server = t;
60     }
61     
62     public void run() {
63         server.start();
64     }
65 }
66
Popular Tags