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