Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
eb2e1e4d
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看板
提交
eb2e1e4d
编写于
11月 25, 2009
作者:
M
mchung
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
cb346a83
79f270f8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
24 deletion
+32
-24
src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java
...lasses/javax/management/remote/rmi/RMIConnectionImpl.java
+32
-24
未找到文件。
src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java
浏览文件 @
eb2e1e4d
...
@@ -1271,6 +1271,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
...
@@ -1271,6 +1271,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
*
*
* @return a String representation of this object.
* @return a String representation of this object.
**/
**/
@Override
public
String
toString
()
{
public
String
toString
()
{
return
super
.
toString
()
+
": connectionId="
+
connectionId
;
return
super
.
toString
()
+
": connectionId="
+
connectionId
;
}
}
...
@@ -1514,6 +1515,21 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
...
@@ -1514,6 +1515,21 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
}
}
}
}
private
static
class
SetCcl
implements
PrivilegedExceptionAction
<
ClassLoader
>
{
private
final
ClassLoader
classLoader
;
SetCcl
(
ClassLoader
classLoader
)
{
this
.
classLoader
=
classLoader
;
}
public
ClassLoader
run
()
{
Thread
currentThread
=
Thread
.
currentThread
();
ClassLoader
old
=
currentThread
.
getContextClassLoader
();
currentThread
.
setContextClassLoader
(
classLoader
);
return
old
;
}
}
private
static
<
T
>
T
unwrap
(
final
MarshalledObject
<?>
mo
,
private
static
<
T
>
T
unwrap
(
final
MarshalledObject
<?>
mo
,
final
ClassLoader
cl
,
final
ClassLoader
cl
,
final
Class
<
T
>
wrappedClass
)
final
Class
<
T
>
wrappedClass
)
...
@@ -1522,22 +1538,14 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
...
@@ -1522,22 +1538,14 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
return
null
;
return
null
;
}
}
try
{
try
{
return
AccessController
.
doPrivileged
(
final
ClassLoader
old
=
AccessController
.
doPrivileged
(
new
SetCcl
(
cl
));
new
PrivilegedExceptionAction
<
T
>()
{
try
{
public
T
run
()
return
wrappedClass
.
cast
(
mo
.
get
());
throws
IOException
{
}
catch
(
ClassNotFoundException
cnfe
)
{
final
ClassLoader
old
=
throw
new
UnmarshalException
(
cnfe
.
toString
(),
cnfe
);
Thread
.
currentThread
().
getContextClassLoader
();
}
finally
{
Thread
.
currentThread
().
setContextClassLoader
(
cl
);
AccessController
.
doPrivileged
(
new
SetCcl
(
old
));
try
{
}
return
wrappedClass
.
cast
(
mo
.
get
());
}
catch
(
ClassNotFoundException
cnfe
)
{
throw
new
UnmarshalException
(
cnfe
.
toString
(),
cnfe
);
}
finally
{
Thread
.
currentThread
().
setContextClassLoader
(
old
);
}
}
});
}
catch
(
PrivilegedActionException
pe
)
{
}
catch
(
PrivilegedActionException
pe
)
{
Exception
e
=
extractException
(
pe
);
Exception
e
=
extractException
(
pe
);
if
(
e
instanceof
IOException
)
{
if
(
e
instanceof
IOException
)
{
...
@@ -1561,14 +1569,14 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
...
@@ -1561,14 +1569,14 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
return
null
;
return
null
;
}
}
try
{
try
{
return
AccessController
.
doPrivileged
(
ClassLoader
orderCL
=
AccessController
.
doPrivileged
(
new
PrivilegedExceptionAction
<
T
>()
{
new
PrivilegedExceptionAction
<
ClassLoader
>()
{
public
T
run
()
public
ClassLoader
run
()
throws
Exception
{
throws
IOException
{
return
new
OrderClassLoaders
(
cl1
,
cl2
);
return
unwrap
(
mo
,
new
OrderClassLoaders
(
cl1
,
cl2
),
}
wrappedClass
);
}
}
);
}
);
return
unwrap
(
mo
,
orderCL
,
wrappedClass
);
}
catch
(
PrivilegedActionException
pe
)
{
}
catch
(
PrivilegedActionException
pe
)
{
Exception
e
=
extractException
(
pe
);
Exception
e
=
extractException
(
pe
);
if
(
e
instanceof
IOException
)
{
if
(
e
instanceof
IOException
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录