1 45 package org.exolab.jms.net; 46 47 import java.rmi.AlreadyBoundException ; 48 import java.rmi.RemoteException ; 49 50 import org.exolab.jms.net.orb.ORB; 51 import org.exolab.jms.net.orb.ORBFactory; 52 import org.exolab.jms.net.proxy.Proxy; 53 54 55 61 public class EchoServer { 62 63 66 private ORB _orb; 67 68 71 private static final String ECHO_SERVICE = "echo"; 72 73 74 82 public EchoServer(String uri) 83 throws AlreadyBoundException , RemoteException { 84 _orb = ORBFactory.createORB(uri); 85 Proxy proxy = _orb.exportObject(new EchoServiceImpl()); 86 _orb.getRegistry().bind(ECHO_SERVICE, proxy); 87 } 88 89 95 public static void main(String args[]) throws Exception { 96 EchoServer server = new EchoServer(args[0]); 97 } 98 } 99 | Popular Tags |