01: package demo.hw_https.server;
02:
03: import javax.xml.ws.Endpoint;
04:
05: public class Server {
06:
07: protected Server() throws Exception {
08: System.out.println("Starting Server");
09:
10: Object implementor = new GreeterImpl();
11: String address = "https://localhost:9001/SoapContext/SoapPort";
12: Endpoint.publish(address, implementor);
13: }
14:
15: public static void main(String args[]) throws Exception {
16: System.out
17: .println("The server's security configuration wil be read from the configuration file, "
18: + "celtix-server.xml using the bean id \"celtix.http-listener.9001\".");
19: if ((args[1] != null)
20: && (args[1].equalsIgnoreCase("strict_server"))) {
21: String configurerProperty = "celtix.security.configurer.celtix.http-listener.9001";
22: String configurerClass = "demo.hw_https.common.DemoSecurityConfigurer";
23: System.setProperty(configurerProperty, configurerClass);
24:
25: System.out
26: .println("Extra security data will be provided by the class, "
27: + configurerClass
28: + " because the system property "
29: + configurerProperty
30: + " has been set to invoke on it.");
31:
32: }
33: System.out.println();
34: new Server();
35: System.out.println("Server ready...");
36:
37: Thread.sleep(5 * 60 * 1000);
38: System.out.println("Server exiting");
39: System.exit(0);
40: }
41: }
|