KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.sapia.ubik.rmi.server.invocation;
2
3 import org.sapia.ubik.rmi.interceptor.Event;
4
5
6 /**
7  * This event is generated on the client-side, after a given
8  * method has been invoked.
9  *
10  * @author Yanick Duchesne
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 ClientPostInvokeEvent implements Event {
18   private InvokeCommand _toInvoke;
19   private Object JavaDoc _return;
20
21   /**
22    * Creates an instance of this class.
23    *
24    * @param invocable the <code>Invocable</code> command to was sent to
25    * the server to perform the method call.
26    * @param toReturn the object returned by the remote method
27    * (might be <code>null</code> (if the called method returned
28    * such); must be <code>Throwable</code> if the called method
29    * threw and exception).
30    */

31   public ClientPostInvokeEvent(InvokeCommand toInvoke, Object JavaDoc toReturn) {
32     _toInvoke = toInvoke;
33     _return = toReturn;
34   }
35
36   /**
37    * Returns the command to invoke.
38    *
39    * @return an <code>InvokeCommand</code> instance.
40    */

41   public InvokeCommand getCommand() {
42     return _toInvoke;
43   }
44
45   /**
46    * Sets this instance return object. The passed in
47    * object must be an instance of the original one.
48    * <p>
49    * This method call is ignored if the original object
50    * reference is <code>null</code>, meaning that the
51    * method actually returned nothing, or has a return
52    * type of <code>void</code>.
53    *
54    * @param an <code>Object</code>.
55    */

56   public void setReturnObject(Object JavaDoc object) {
57     if (_return != null) {
58       _return = object;
59     }
60   }
61
62   /**
63    * Returns the object that was returned by the remote
64    * method call.
65    * <p>
66    * Important: the object that will be returned might be an
67    * instance of <code>Throwable</code>, provided the method
68    * threw an exception.
69    *
70    * @return an <code>Object</code>, or <code>null</code> if
71    * the invoked remote method returned nothing, or has a
72    * return type of <code>void</code>.
73    */

74   public Object JavaDoc getReturnObject() {
75     return _return;
76   }
77 }
78
Popular Tags