Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d94047

Browse files
committed
✨ 添加代理模式,动态代理,CGLIB动态代理
1 parent 0624eda commit 7d94047

File tree

1 file changed

+10
-0
lines changed
  • src/main/java/com/xkcoding/design/pattern/structural/proxy/dynamicproxy/cglib

1 file changed

+10
-0
lines changed

src/main/java/com/xkcoding/design/pattern/structural/proxy/dynamicproxy/cglib/Conductor.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ public Object getInstance(Class<?> clazz) {
2626
return enhancer.create();
2727
}
2828

29+
/**
30+
* 代理对象执行的所有方法都会走这个方法
31+
*
32+
* @param o 被代理的对象
33+
* @param method 被代理对象需要执行的方法
34+
* @param objects 被代理对象需要执行的方法 参数
35+
* @param methodProxy 触发父类的方法对象
36+
* @return 被代理对象需要执行的方法 返回值
37+
* @throws Throwable 抛出的异常信息
38+
*/
2939
@Override
3040
public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
3141
before();

0 commit comments

Comments
 (0)