From b5bcaeddc023060e96817c1e7d3c1cb7ebdec8e6 Mon Sep 17 00:00:00 2001 From: aoshiguchen <1052045476@qq.com> Date: Sat, 10 Sep 2022 12:40:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86ProxyCompiler=E7=B1=BB=E6=A0=87?= =?UTF-8?q?=E4=B8=BA=E5=BA=9F=E5=BC=83=EF=BC=8C=E5=B9=B6=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E4=B8=BAAsgcCompiler=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../neutrino/core/aop/proxy/AsgcProxyFactory.java | 14 +++----------- .../neutrino/core/aop/proxy/ProxyCompiler.java | 1 + 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/proxy/AsgcProxyFactory.java b/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/proxy/AsgcProxyFactory.java index acda3524..aa0acdc1 100644 --- a/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/proxy/AsgcProxyFactory.java +++ b/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/proxy/AsgcProxyFactory.java @@ -21,6 +21,7 @@ */ package fun.asgc.neutrino.core.aop.proxy; +import fun.asgc.neutrino.core.aop.compiler.AsgcCompiler; import fun.asgc.neutrino.core.base.GlobalConfig; import fun.asgc.neutrino.core.util.*; import lombok.extern.slf4j.Slf4j; @@ -38,7 +39,7 @@ public class AsgcProxyFactory implements ProxyFactory { private static final String SYMBOLIC = "AsgcProxy$$"; private static final String classNameTemplate = "%s" + SYMBOLIC + "%s"; private static AtomicLong proxyClassCounter = new AtomicLong(); - private ProxyCompiler compiler = new ProxyCompiler(); + private AsgcCompiler compiler = new AsgcCompiler(); private ProxyClassLoader classLoader = new ProxyClassLoader(); @Override @@ -85,20 +86,11 @@ public class AsgcProxyFactory implements ProxyFactory { if (GlobalConfig.isPrintGeneratorCode()) { log.debug("类:{} 的代理类源码:\n{}", targetType.getName(), sourceCode); } - Class
retClass = compile(proxyClass); + Class
retClass = (Class
)compiler.compile(proxyClass.getPkg(), proxyClass.getName(), proxyClass.getSourceCode());
P obj = retClass.newInstance();
return obj;
}
- private