KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.sapia.ubik.rmi.server.invocation;
2
3 import org.sapia.ubik.rmi.interceptor.Event;
4
5
6 /**
7  * An event signaling that a remote method call has been
8  * received on the server-side.
9  *
10  * @author Yanick
11  * <dl>
12  * <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>
13  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
14  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
15  * </dl>
16  */

17 public class ServerPreInvokeEvent implements Event {
18   private InvokeCommand _cmd;
19   private Object JavaDoc _target;
20   private long _start = System.currentTimeMillis();
21
22   /**
23    * @param cmd the command representing the method invocation that will be performed.
24    * @param target the object on which the invocation will be performed.
25    */

26   ServerPreInvokeEvent(InvokeCommand cmd, Object JavaDoc target) {
27     _cmd = cmd;
28     _target = target;
29   }
30
31   /**
32    * Returns the command that represents the method invocation that will
33    * be performed.
34    *
35    * @return an <code>InvokeCommand</code>.
36    */

37   public InvokeCommand getInvokeCommand() {
38     return _cmd;
39   }
40
41   /**
42    * Sets the target of the invocation (client-applications can thus
43    * substitute the original target with the one passed in).
44    *
45    * @param target a new target on which to perform the invocation.
46    */

47   public void setTarget(Object JavaDoc target) {
48     _target = target;
49   }
50
51   /**
52    * Returns the object on which to perform the method call.
53    *
54    * @return an <code>Object</code>.
55    */

56   public Object JavaDoc getTarget() {
57     return _target;
58   }
59
60   /**
61    * Returns the approximate time at which the invocation
62    * was received.
63    *
64    * @return a time in milliseconds.
65    */

66   public long getInvokeTime() {
67     return _start;
68   }
69 }
70
Popular Tags