KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > rmi > examples > replication > Client


1 package org.sapia.ubik.rmi.examples.replication;
2
3 import org.sapia.ubik.rmi.examples.Foo;
4 import org.sapia.ubik.rmi.server.Hub;
5 import org.sapia.ubik.rmi.server.invocation.ClientPreInvokeEvent;
6
7
8 /**
9  * @author Yanick Duchesne
10  * <dl>
11  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2004 <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 Client {
17   public static void main(String JavaDoc[] args) {
18     try {
19       Hub.clientRuntime.addInterceptor(ClientPreInvokeEvent.class,
20         new ClientSideInterceptor(new ReplicatedInvokerImpl()));
21
22       Foo f = (Foo) Hub.connect("localhost", 9000);
23       f.getBar();
24     } catch (Exception JavaDoc e) {
25       e.printStackTrace();
26     }
27   }
28 }
29
Popular Tags