Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Meiracle
spring-framework
提交
2b017fe5
S
spring-framework
项目概览
Meiracle
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2b017fe5
编写于
3月 10, 2021
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Apply original ClassLoader in AbstractAdvisingBeanPostProcessor as well
See gh-26601
上级
61cdd647
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
6 deletion
+14
-6
spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java
...work/aop/framework/AbstractAdvisingBeanPostProcessor.java
+9
-2
spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java
...ork/aop/framework/autoproxy/AbstractAutoProxyCreator.java
+5
-4
未找到文件。
spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java
浏览文件 @
2b017fe5
/*
* Copyright 2002-20
18
the original author or authors.
* Copyright 2002-20
21
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import
org.springframework.aop.Advisor
;
import
org.springframework.aop.support.AopUtils
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.core.SmartClassLoader
;
import
org.springframework.lang.Nullable
;
/**
...
...
@@ -89,7 +90,13 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
}
proxyFactory
.
addAdvisor
(
this
.
advisor
);
customizeProxyFactory
(
proxyFactory
);
return
proxyFactory
.
getProxy
(
getProxyClassLoader
());
// Use original ClassLoader if bean class not locally loaded in overriding class loader
ClassLoader
classLoader
=
getProxyClassLoader
();
if
(
classLoader
instanceof
SmartClassLoader
&&
classLoader
!=
bean
.
getClass
().
getClassLoader
())
{
classLoader
=
((
SmartClassLoader
)
classLoader
).
getOriginalClassLoader
();
}
return
proxyFactory
.
getProxy
(
classLoader
);
}
// No proxy needed.
...
...
spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java
浏览文件 @
2b017fe5
...
...
@@ -459,11 +459,12 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
proxyFactory
.
setPreFiltered
(
true
);
}
ClassLoader
targetClassLoader
=
getProxyClassLoader
();
if
(
targetClassLoader
instanceof
SmartClassLoader
&&
targetClassLoader
!=
beanClass
.
getClassLoader
())
{
targetClassLoader
=
((
SmartClassLoader
)
targetClassLoader
).
getOriginalClassLoader
();
// Use original ClassLoader if bean class not locally loaded in overriding class loader
ClassLoader
classLoader
=
getProxyClassLoader
();
if
(
classLoader
instanceof
SmartClassLoader
&&
classLoader
!=
beanClass
.
getClassLoader
())
{
classLoader
=
((
SmartClassLoader
)
classLoader
).
getOriginalClassLoader
();
}
return
proxyFactory
.
getProxy
(
targetC
lassLoader
);
return
proxyFactory
.
getProxy
(
c
lassLoader
);
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录