mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
commit
62721ec58a
@ -229,7 +229,7 @@ public class DebugInvocationHandler implements InvocationHandler {
|
|||||||
public class JdkProxyFactory {
|
public class JdkProxyFactory {
|
||||||
public static Object getProxy(Object target) {
|
public static Object getProxy(Object target) {
|
||||||
return Proxy.newProxyInstance(
|
return Proxy.newProxyInstance(
|
||||||
target.getClass().getClassLoader(), // 目标类的类加载
|
target.getClass().getClassLoader(), // 目标类的类加载器
|
||||||
target.getClass().getInterfaces(), // 代理需要实现的接口,可指定多个
|
target.getClass().getInterfaces(), // 代理需要实现的接口,可指定多个
|
||||||
new DebugInvocationHandler(target) // 代理对象对应的自定义 InvocationHandler
|
new DebugInvocationHandler(target) // 代理对象对应的自定义 InvocationHandler
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user