01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.common.proxy;
05:
06: import java.lang.reflect.Method;
07:
08: /**
09: * 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 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[] 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 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 getReturnValue();
49:
50: /**
51: * @return the object upon which the method was invoked.
52: */
53: public Object getInvokedObject();
54: }
|