public class Proxy extends Object implements InvocationHandler
| 构造器和说明 |
|---|
Proxy(Object object,
Interceptor interceptor,
ArrayList<Method> interceptsList) |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
invoke(Object proxy,
Method method,
Object[] args) |
static Object |
staticserviceConsumer(ProxyFactory proxyFactory,
Proxy proxy,
Object target) |
static Object |
wrap(Object target,
Interceptor interceptor)
代理的入口
|
static Object |
wrap(Object target,
Interceptor interceptor,
boolean isJdkProxy)
代理的入口
|
public Proxy(Object object, Interceptor interceptor, ArrayList<Method> interceptsList)
public static Object wrap(Object target, Interceptor interceptor) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException
target - 被代理对象interceptor - 代理逻辑ClassNotFoundExceptionNoSuchMethodExceptionInvocationTargetExceptionInstantiationExceptionIllegalAccessExceptionpublic static Object wrap(Object target, Interceptor interceptor, boolean isJdkProxy) throws ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException
target - 被代理对象interceptor - 代理逻辑isJdkProxy - true 使用jdk ,false asmClassNotFoundExceptionIllegalAccessExceptionInstantiationExceptionNoSuchMethodExceptionInvocationTargetExceptionpublic static Object staticserviceConsumer(ProxyFactory proxyFactory, Proxy proxy, Object target) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException
Copyright © 2017. All Rights Reserved.