|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mockejb.interceptor.InterceptorInvoker
Requests the interceptors from the AspectSystem and initiates the call to the interceptor chain. Allows to setup the custom context (properties) that is passed down to interceptors. Clients can reuse the same object of this class for all method calls (provided that that the custom context is the same).
Nested Class Summary | |
static class |
InterceptorInvoker.CglibMethodInvoker
Calls the object's method using Cglib. |
Constructor Summary | |
InterceptorInvoker()
|
Method Summary | |
java.lang.Object |
getContext(java.lang.String key)
Returns the context associated with the provided key or null if the key is not found. |
java.lang.Object |
invoke(java.lang.Object proxyObj,
java.lang.reflect.Method proxyMethod,
java.lang.Object targetObj,
java.lang.reflect.Method targetMethod,
java.lang.Object[] paramVals)
Calls AspectSystem to find the interceptors for the given invokedMethod and targetMethod, creates the invocationContext and proceeds to calling the first interceptor. |
void |
setContext(java.lang.String key,
java.lang.Object data)
Sets the custom context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InterceptorInvoker()
Method Detail |
public java.lang.Object invoke(java.lang.Object proxyObj, java.lang.reflect.Method proxyMethod, java.lang.Object targetObj, java.lang.reflect.Method targetMethod, java.lang.Object[] paramVals) throws java.lang.Exception
proxyObj
- dynamic proxy or the object enhanced by CGLIB.proxyMethod
- method invoked by the client on the proxy. Normally, this is an interface method
(the declaring class is the interface).targetObj
- object to call, e.g., EJB implementation objecttargetMethod
- method to call on the target object, e.g., method of the EJB implementation clsessparamVals
- method parameters
java.lang.Exception
public void setContext(java.lang.String key, java.lang.Object data)
key
- key for this context's datadata
- context datapublic java.lang.Object getContext(java.lang.String key)
key
- context key
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |