KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > performance > basic_type > server > Server


1 package org.objectweb.celtix.performance.basic_type.server;
2
3 import javax.xml.ws.Endpoint;
4
5 import org.objectweb.celtix.Bus;
6 import org.objectweb.celtix.BusException;
7
8 public class Server implements Runnable JavaDoc {
9
10     Bus bus;
11     
12     public Server(Bus b, String JavaDoc address) throws Exception JavaDoc {
13         System.out.println("Starting Server");
14         bus = b;
15         Object JavaDoc implementor = new ServerImpl();
16         Endpoint.publish(address, implementor);
17         System.out.println("Server published");
18     }
19
20     public Server(String JavaDoc[] args) throws Exception JavaDoc {
21         this(Bus.init(args), "http://localhost:20000/performance/basic_type/SoapPort");
22     }
23     
24     public static void main(String JavaDoc args[]) throws Exception JavaDoc {
25         Server server = new Server(args);
26         server.run();
27     }
28     
29     public void run() {
30         System.out.println("running bus");
31         System.out.println(" READY ");
32         bus.run();
33         
34     }
35     
36     void shutdown(boolean wait) throws BusException {
37         System.out.println("shutting down bus");
38         bus.shutdown(wait);
39     }
40 }
41
Popular Tags