KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > common > proxy > MethodInvocationEvent


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.common.proxy;
5
6 import java.lang.reflect.Method JavaDoc;
7
8 /**
9  * An method invocation event fired by Proxy instances created with MethodMonitorProxy. The event is delivered AFTER the
10  * method has executed, but before the caller receives any thrown exceptions
11  */

12 public interface MethodInvocationEvent {
13
14   /**
15    * The Method that was invoked
16    */

17   public Method JavaDoc getMethod();
18
19   /**
20    * The arguments to the method invocation NOTE: These may be live references to the method arguments. You are NOT
21    * advised to modify the state of any of these parameters
22    */

23   public Object JavaDoc[] getArguments();
24
25   /**
26    * The start time of the method invocation as measured by System.currentTimeMillis();
27    */

28   public long getExecutionStartTime();
29
30   /**
31    * The end time of the method invocation as measured by System.currentTimeMillis();
32    */

33   public long getExecutionEndTime();
34
35   /**
36    * The exception (if any) thrown by this method invocation. The value of this method may be null (indficating the lack
37    * of a thrown exception)
38    */

39   public Throwable JavaDoc getException();
40
41   /**
42    * The return value of the method invocation. A return value of null can either mean a true "null" return value, or
43    * that an exception is being thrown (ie. you should always be checking getException() before getReturnValue()).
44    * Additioanlly, a null value here may be the result of the return type of the method being Void.TYPE <br>
45    * <br>
46    * NOTE: You really don't want to be mucking with the return value, but nothing is stopping you
47    */

48   public Object JavaDoc getReturnValue();
49
50   /**
51    * @return the object upon which the method was invoked.
52    */

53   public Object JavaDoc getInvokedObject();
54 }
Popular Tags