KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > rmi > examples > JdkFoo


1 package org.sapia.ubik.rmi.examples;
2
3 import java.rmi.RemoteException JavaDoc;
4 import java.rmi.registry.LocateRegistry JavaDoc;
5 import java.rmi.server.UnicastRemoteObject JavaDoc;
6
7
8 /**
9  * @author Yanick Duchesne
10  * <dl>
11  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
12  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
13  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
14  * </dl>
15  */

16 public class JdkFoo extends UnicastRemoteObject JavaDoc implements Foo {
17   public JdkFoo() throws java.rmi.RemoteException JavaDoc {
18   }
19
20   /**
21    * @see org.sapia.ubik.rmi.Foo#getBar()
22    */

23   public Bar getBar() throws RemoteException JavaDoc {
24     return new JdkBar();
25   }
26
27   public static void main(String JavaDoc[] args) {
28     try {
29       java.rmi.registry.Registry JavaDoc 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 JavaDoc t) {
39       t.printStackTrace();
40     }
41   }
42 }
43
Popular Tags