KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > ubik > rmi > server > invocation > ClientPreInvokeEvent


1 package org.sapia.ubik.rmi.server.invocation;
2
3 import org.sapia.ubik.rmi.interceptor.Event;
4
5
6 /**
7  * This instance is generated on the client-size prior to a
8  * remote method call.
9  * <p>
10  * Intercepting this event allows to implement substitution behavior,
11  * such as:
12  * <pre>
13  * ...
14  * InvokeCommand inv = event.getInvocable();
15  * Credentials cre = SecurityController.getCredentials();
16  * SecureInvocationCommand sec = new SecureInvokationCommand(inv);
17  * evt.setCommand(sec);
18  * ...
19  * </pre>
20  *
21  * @author Yanick Duchesne
22  * <dl>
23  * <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>
24  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
25  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
26  * </dl>
27  */

28 public class ClientPreInvokeEvent implements Event {
29   private InvokeCommand _cmd;
30
31   public ClientPreInvokeEvent(InvokeCommand cmd) {
32     _cmd = cmd;
33   }
34
35   /**
36    * Return the command that will be sent to the server.
37    *
38    * @return am <code>InvokeCommand</code> instance.
39    */

40   public InvokeCommand getCommand() {
41     return _cmd;
42   }
43
44   /**
45    * Sets the command that will be sent to the server.
46    *
47    * @param an <code>InvokeCommand</code>.
48    */

49   public void setCommand(InvokeCommand cmd) {
50     _cmd = cmd;
51   }
52 }
53
Popular Tags