1 package org.objectweb.hello_world_soap_http; 2 3 import javax.xml.ws.Endpoint; 4 5 import org.objectweb.celtix.Bus; 6 7 public class GreeterServerMain { 8 9 protected GreeterServerMain() { 10 } 11 12 public static void main(String args[]) throws Exception { 13 System.out.println("Starting Server"); 14 15 19 20 Bus bus = Bus.init(args); 21 Runtime.getRuntime().addShutdownHook( 22 new Thread (new GreeterServerMain().new TerminationHandler(bus, true))); 23 Object implementor = new AnnotatedGreeterImpl(); 24 String address = "http://loalhost:8080/hello_world_soap_http"; 25 Endpoint.publish(address, implementor); 26 bus.run(); 27 } 28 29 private class TerminationHandler implements Runnable { 30 private final Bus bus; 31 private final boolean processRemainingTasks; 32 33 TerminationHandler(Bus b, boolean p) { 34 bus = b; 35 processRemainingTasks = p; 36 } 37 38 public void run() { 39 try { 40 bus.shutdown(processRemainingTasks); 41 } catch (Exception ex) { 42 System.err.println("Failed to shutdown the bus:\n" + ex.getMessage()); 43 } 44 } 45 } 46 } 47 | Popular Tags |