|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cglib.BeforeAfterInterceptor
An implementation of MethodInterceptor provides separate callbacks for code to execute before and after the original method execution.
Constructor Summary | |
BeforeAfterInterceptor()
|
Method Summary | |
abstract java.lang.Object |
afterReturn(java.lang.Object obj,
java.lang.reflect.Method method,
java.lang.Object[] args,
boolean invokedSuper,
java.lang.Object retValFromSuper,
java.lang.Throwable e)
This method is called after invoking the super (non-intercepted) method, or directly after the invokeSuper interceptor method, if it returned false. |
java.lang.Object |
intercept(java.lang.Object obj,
java.lang.reflect.Method method,
java.lang.Object[] args,
MethodProxy proxy)
All generated proxied methods call this method instead of the original method. |
abstract boolean |
invokeSuper(java.lang.Object obj,
java.lang.reflect.Method method,
java.lang.Object[] args)
This method is called before invoking the super (non-intercepted) method. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BeforeAfterInterceptor()
Method Detail |
public java.lang.Object intercept(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, MethodProxy proxy) throws java.lang.Throwable
MethodInterceptor
intercept
in interface MethodInterceptor
obj
- "this", the enhanced objectmethod
- intercepted Methodargs
- argument array; primitive types are wrappedproxy
- used to invoke super (non-intercepted method); may be called
as many times as needed
java.lang.Throwable
- any exception may be thrown; if so, super method will not be invokedMethodProxy
public abstract boolean invokeSuper(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
obj
- "this", the enhanced objectmethod
- intercepted Methodargs
- argument array; primitive types are wrapped
java.lang.Throwable
- any exception may be thrown; super method will not be invokedpublic abstract java.lang.Object afterReturn(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, boolean invokedSuper, java.lang.Object retValFromSuper, java.lang.Throwable e) throws java.lang.Throwable
obj
- "this", the enhanced objectmethod
- intercepted Methodargs
- argument array; primitive types are wrappedinvokedSuper
- whether the super method was invokedretValFromSuper
- value returned from super (unless there was an exception)e
- Throwable thrown by the super method (if any)
java.lang.Throwable
- any exception may be thrown
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |