KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > demo > hw_https > server > Server


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