Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8918d557
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8918d557
编写于
3月 21, 2013
作者:
J
jbachorik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8008623: Better handling of MBeanServers
Reviewed-by: dfuchs, dholmes, skoivu
上级
5a34bb4d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
41 addition
and
10 deletion
+41
-10
src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java
...om/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java
+10
-5
src/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java
...share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java
+18
-3
src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
...re/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
+13
-2
未找到文件。
src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java
浏览文件 @
8918d557
...
...
@@ -1973,8 +1973,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
* does not add it to the list that is consulted by
* ClassLoaderRepository.loadClass.
*/
final
ModifiableClassLoaderRepository
clr
=
instantiator
.
getClassLoaderRepository
();
final
ModifiableClassLoaderRepository
clr
=
getInstantiatorCLR
();
if
(
clr
==
null
)
{
final
RuntimeException
wrapped
=
new
IllegalArgumentException
(
...
...
@@ -2000,8 +1999,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
* Removes the MBean from the default loader repository.
*/
if
(
loader
!=
server
.
getClass
().
getClassLoader
())
{
final
ModifiableClassLoaderRepository
clr
=
instantiator
.
getClassLoaderRepository
();
final
ModifiableClassLoaderRepository
clr
=
getInstantiatorCLR
();
if
(
clr
!=
null
)
{
clr
.
removeClassLoader
(
logicalName
);
}
...
...
@@ -2060,5 +2058,12 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
return
ResourceContext
.
NONE
;
}
private
ModifiableClassLoaderRepository
getInstantiatorCLR
()
{
return
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
ModifiableClassLoaderRepository
>()
{
@Override
public
ModifiableClassLoaderRepository
run
()
{
return
instantiator
!=
null
?
instantiator
.
getClassLoaderRepository
()
:
null
;
}
});
}
}
src/share/classes/com/sun/jmx/mbeanserver/JmxMBeanServer.java
浏览文件 @
8918d557
...
...
@@ -32,6 +32,7 @@ import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
import
java.io.ObjectInputStream
;
import
java.security.AccessController
;
import
java.security.Permission
;
import
java.security.PrivilegedAction
;
import
java.security.PrivilegedExceptionAction
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -227,8 +228,16 @@ public final class JmxMBeanServer
clr
=
new
ClassLoaderRepositorySupport
();
instantiator
=
new
MBeanInstantiator
(
clr
);
}
final
MBeanInstantiator
fInstantiator
=
instantiator
;
this
.
secureClr
=
new
SecureClassLoaderRepository
(
instantiator
.
getClassLoaderRepository
());
SecureClassLoaderRepository
(
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
ClassLoaderRepository
>()
{
@Override
public
ClassLoaderRepository
run
()
{
return
fInstantiator
.
getClassLoaderRepository
();
}
})
);
if
(
delegate
==
null
)
delegate
=
new
MBeanServerDelegateImpl
();
if
(
outer
==
null
)
...
...
@@ -1242,8 +1251,14 @@ public final class JmxMBeanServer
class loader. The ClassLoaderRepository knows how
to handle that case. */
ClassLoader
myLoader
=
outerShell
.
getClass
().
getClassLoader
();
final
ModifiableClassLoaderRepository
loaders
=
instantiator
.
getClassLoaderRepository
();
final
ModifiableClassLoaderRepository
loaders
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
ModifiableClassLoaderRepository
>()
{
@Override
public
ModifiableClassLoaderRepository
run
()
{
return
instantiator
.
getClassLoaderRepository
();
}
});
if
(
loaders
!=
null
)
{
loaders
.
addClassLoader
(
myLoader
);
...
...
src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
浏览文件 @
8918d557
...
...
@@ -622,6 +622,7 @@ public class MBeanInstantiator {
* Return the Default Loader Repository used by this instantiator object.
**/
public
ModifiableClassLoaderRepository
getClassLoaderRepository
()
{
checkMBeanPermission
((
String
)
null
,
null
,
null
,
"getClassLoaderRepository"
);
return
clr
;
}
...
...
@@ -733,9 +734,19 @@ public class MBeanInstantiator {
String
member
,
ObjectName
objectName
,
String
actions
)
{
if
(
clazz
!=
null
)
{
checkMBeanPermission
(
clazz
.
getName
(),
member
,
objectName
,
actions
);
}
}
private
static
void
checkMBeanPermission
(
String
classname
,
String
member
,
ObjectName
objectName
,
String
actions
)
throws
SecurityException
{
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
clazz
!=
null
&&
sm
!=
null
)
{
Permission
perm
=
new
MBeanPermission
(
cla
zz
.
getName
()
,
if
(
sm
!=
null
)
{
Permission
perm
=
new
MBeanPermission
(
cla
ssname
,
member
,
objectName
,
actions
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录