1 package org.sapia.ubik.rmi.examples; 2 3 import java.rmi.RemoteException ; 4 import java.rmi.registry.LocateRegistry ; 5 import java.rmi.server.UnicastRemoteObject ; 6 7 8 16 public class JdkFoo extends UnicastRemoteObject implements Foo { 17 public JdkFoo() throws java.rmi.RemoteException { 18 } 19 20 23 public Bar getBar() throws RemoteException { 24 return new JdkBar(); 25 } 26 27 public static void main(String [] args) { 28 try { 29 java.rmi.registry.Registry reg = LocateRegistry.createRegistry(1098); 30 Foo f = new JdkFoo(); 31 java.rmi.Naming.bind("rmi://localhost:1098/Foo", f); 32 33 System.out.println("JdkFoo started..."); 34 35 while (true) { 36 Thread.sleep(10000); 37 } 38 } catch (Throwable t) { 39 t.printStackTrace(); 40 } 41 } 42 } 43 | Popular Tags |