com.bstek.dorado.util.proxy
public abstract class MethodInterceptorDispatcher extends java.lang.Object implements org.aopalliance.intercept.MethodInterceptor, net.sf.cglib.proxy.MethodInterceptor, javassist.util.proxy.MethodHandler
此类主要用于将一个基于net.sf.cglib.proxy.MethodInterceptor的方法拦截器中的调用 分发到一个或一组org.aopalliance.intercept.MethodInterceptor方法拦截器中。 使用此分发器即可以保证应用中定义的org.aopalliance.intercept.MethodInterceptor方法拦截器 可以同时应用于Cglib和Spring AOP,又可以实现对方法的迭代拦截(即同时启用多个拦截器拦截被代理对象的同一个方法)。
Constructor and Description |
---|
MethodInterceptorDispatcher() |
Modifier and Type | Method and Description |
---|---|
protected org.aopalliance.intercept.MethodInterceptor |
createCglibFinalMethodInterceptor(net.sf.cglib.proxy.MethodProxy methodProxy) |
protected org.aopalliance.intercept.MethodInterceptor |
createFinalAopallianceMethodInterceptor(org.aopalliance.intercept.MethodInvocation methodInvocation) |
protected org.aopalliance.intercept.MethodInterceptor |
createJavassistFinalMethodInterceptor(java.lang.reflect.Method method,
java.lang.reflect.Method procssed) |
protected abstract org.aopalliance.intercept.MethodInvocation |
createMethodInvocation(java.lang.Object object,
java.lang.reflect.Method method,
java.lang.Object[] args,
MethodInterceptorChain methodInterceptorChain)
创建一个用于org.aopalliance.intercept.
|
protected boolean |
filterMethod(java.lang.reflect.Method method) |
abstract MethodInterceptorFilter |
getMethodInterceptorFilter(java.lang.Object object,
java.lang.reflect.Method method,
java.lang.Object[] args) |
protected java.lang.Object |
getObjectForSerialization(java.lang.Object object) |
org.aopalliance.intercept.MethodInterceptor[] |
getSubMethodInterceptors()
返回子方法拦截器的数组。
|
java.lang.Object |
intercept(java.lang.Object object,
java.lang.reflect.Method method,
java.lang.Object[] args,
net.sf.cglib.proxy.MethodProxy methodProxy) |
java.lang.Object |
invoke(org.aopalliance.intercept.MethodInvocation methodInvocation) |
java.lang.Object |
invoke(java.lang.Object object,
java.lang.reflect.Method method,
java.lang.reflect.Method procssed,
java.lang.Object[] args) |
void |
setSubMethodInterceptors(org.aopalliance.intercept.MethodInterceptor[] subMethodInterceptors) |
public org.aopalliance.intercept.MethodInterceptor[] getSubMethodInterceptors()
public void setSubMethodInterceptors(org.aopalliance.intercept.MethodInterceptor[] subMethodInterceptors)
public abstract MethodInterceptorFilter getMethodInterceptorFilter(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] args)
protected abstract org.aopalliance.intercept.MethodInvocation createMethodInvocation(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] args, MethodInterceptorChain methodInterceptorChain)
object
- 被代理对象method
- 被代理方法args
- 被代理方法的参数methodInterceptorChain
- 用于迭代所有子方法拦截器的迭代器(包含
#createFinalMethodInterceptor(MethodProxy)
返回的拦截器)protected org.aopalliance.intercept.MethodInterceptor createFinalAopallianceMethodInterceptor(org.aopalliance.intercept.MethodInvocation methodInvocation)
protected org.aopalliance.intercept.MethodInterceptor createCglibFinalMethodInterceptor(net.sf.cglib.proxy.MethodProxy methodProxy)
protected org.aopalliance.intercept.MethodInterceptor createJavassistFinalMethodInterceptor(java.lang.reflect.Method method, java.lang.reflect.Method procssed)
protected boolean filterMethod(java.lang.reflect.Method method)
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation) throws java.lang.Throwable
java.lang.Throwable
public java.lang.Object intercept(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] args, net.sf.cglib.proxy.MethodProxy methodProxy) throws java.lang.Throwable
intercept
in interface net.sf.cglib.proxy.MethodInterceptor
java.lang.Throwable
protected java.lang.Object getObjectForSerialization(java.lang.Object object) throws java.lang.Exception
java.lang.Exception
public java.lang.Object invoke(java.lang.Object object, java.lang.reflect.Method method, java.lang.reflect.Method procssed, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface javassist.util.proxy.MethodHandler
java.lang.Throwable
Copyright © 2001-2011 www.BSTEK.com All Rights Reserved.