| 程序包 | 说明 |
|---|---|
| cn.com.fishin.tuz.factory | |
| cn.com.fishin.tuz.handler | |
| cn.com.fishin.tuz.helper | |
| cn.com.fishin.tuz.interceptor | |
| cn.com.fishin.tuz.plugin |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.lang.Object |
ProxyFactory.wrap(java.lang.Object target,
Interceptor[] interceptors)
返回实际产生的动态代理类对象
这里会进行目标对象判断,如果是有接口的,就直接使用 JDK 内置的动态代理
如果没有实现接口,就是用 CGlib 进行动态代理
Return a dynamic proxy instance
If target object has interface, then use JDK dynamic proxy,
else use CGlib to proxy
|
| 构造器和说明 |
|---|
InterceptorInvocationHandler(java.lang.Object target,
Interceptor[] interceptors)
使用目标代理对象和拦截器进行初始化
Use target object and interceptors to init
|
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
InterceptorHelper.after(Interceptor[] interceptors,
InterceptedMethod method)
完成一组拦截器的 after 方法
Invoke after method of these interceptors
|
static boolean |
InterceptorHelper.afterReturning(Interceptor[] interceptors,
InterceptedMethod method)
完成一组拦截器的 afterReturning 方法
Invoke afterReturning method of these interceptors
|
static boolean |
InterceptorHelper.afterThrowing(Interceptor[] interceptors,
InterceptedMethod method)
完成一组拦截器的 afterThrowing 方法
Invoke afterThrowing method of these interceptors
|
static boolean |
InterceptorHelper.before(Interceptor[] interceptors,
InterceptedMethod method)
完成一组拦截器的 before 方法
Invoke before method of these interceptors
|
| 限定符和类型 | 类和说明 |
|---|---|
class |
DefaultInterceptor
默认的拦截器
建议继承这个类,选择性覆盖要拦截的方法
Default interceptor
Recommend to extend this class, and override methods selectively
|
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
ProxyPlugin.useInstance(java.lang.Class<T> classType,
boolean singleton,
Interceptor[] interceptors)
得到类被拦截器代理之后的实例
这里会根据 classType 的 getSimpleName() 去获取 key,并且利用反射生成实例对象
Get class instance after intercepting
Use reflect to instance a new object with given classType's simpleName
|
static <T> T |
ProxyPlugin.useInstance(java.lang.Class<T> classType,
Interceptor[] interceptors)
得到类被拦截器代理之后的实例
这里会根据 classType 的 getSimpleName() 去获取 key,并且利用反射生成实例对象
注意这里的实例模式是根据 Tuz.getConfig().isSingleton() 中的设置来决定的
Get class instance after intercepting
Use reflect to instance a new object with given classType's simpleName
Notice that the mode creates the instance depends on Tuz.getConfig().isSingleton()
|
static <T> T |
ProxyPlugin.useInstance(java.lang.String key,
java.lang.Class<T> classType,
boolean singleton,
Interceptor[] interceptors)
得到类被拦截器代理之后的实例
这里会根据 key 值获取 value,并且利用反射生成实例对象
Get class instance after intercepting
Use reflect to instance a new object with given value of key
|
static <T> T |
ProxyPlugin.useInstance(java.lang.String key,
java.lang.Class<T> classType,
Interceptor[] interceptors)
得到类被拦截器代理之后的实例
这里会根据 key 值获取 value,并且利用反射生成实例对象
注意这里的实例模式是根据 Tuz.getConfig().isSingleton() 中的设置来决定的
Get class instance after intercepting
Use reflect to instance a new object with given value of key
Notice that the mode creates the instance depends on Tuz.getConfig().isSingleton()
|
static <T> T |
ProxyPlugin.useInstance(java.lang.String key,
java.lang.String namespace,
java.lang.Class<T> classType,
boolean singleton,
Interceptor[] interceptors)
得到类被拦截器代理之后的实例
这里会根据 key 值获取 value,并且利用反射生成实例对象
Get class instance after intercepting
Use reflect to instance a new object with given value of key
|
static <T> T |
ProxyPlugin.useInstance(java.lang.String key,
java.lang.String namespace,
java.lang.Class<T> classType,
Interceptor[] interceptors)
得到类被拦截器代理之后的实例
这里会根据 key 值获取 value,并且利用反射生成实例对象
注意这里的实例模式是根据 Tuz.getConfig().isSingleton() 中的设置来决定的
Get class instance after intercepting
Use reflect to instance a new object with given value of key
Notice that the mode creates the instance depends on Tuz.getConfig().isSingleton()
|
Copyright © 2019. All Rights Reserved.