KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.sapia.ubik.rmi.examples.replication;
2
3 import org.sapia.ubik.rmi.interceptor.Interceptor;
4 import org.sapia.ubik.rmi.replication.ReplicatedInvoker;
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 ClientSideInterceptor implements Interceptor {
17   private ReplicatedInvoker _invoker;
18
19   public ClientSideInterceptor(ReplicatedInvoker invoker) {
20     _invoker = invoker;
21   }
22
23   public void onClientPreInvokeEvent(ClientPreInvokeEvent evt) {
24     System.out.println("Command will be replicated...");
25     evt.setCommand(new ReplicatedCommandEx(evt.getCommand(), null, _invoker));
26   }
27 }
28
Popular Tags