Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d94ca2fd
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看板
提交
d94ca2fd
编写于
8月 05, 2013
作者:
S
smarks
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8020854: change RMI javadocs to specify that remote objects are exported to the wildcard address
Reviewed-by: rgallard, alanb
上级
b803c8a4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
57 addition
and
5 deletion
+57
-5
src/share/classes/java/rmi/server/RMISocketFactory.java
src/share/classes/java/rmi/server/RMISocketFactory.java
+36
-4
src/share/classes/java/rmi/server/UnicastRemoteObject.java
src/share/classes/java/rmi/server/UnicastRemoteObject.java
+21
-1
未找到文件。
src/share/classes/java/rmi/server/RMISocketFactory.java
浏览文件 @
d94ca2fd
/*
/*
* Copyright (c) 1996, 20
02
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
13
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -33,15 +33,47 @@ import java.net.*;
...
@@ -33,15 +33,47 @@ import java.net.*;
* in order to obtain client and server sockets for RMI calls. An
* in order to obtain client and server sockets for RMI calls. An
* application may use the <code>setSocketFactory</code> method to
* application may use the <code>setSocketFactory</code> method to
* request that the RMI runtime use its socket factory instance
* request that the RMI runtime use its socket factory instance
* instead of the default implementation.
<p>
* instead of the default implementation.
*
*
*
The default socket factory implementation used goes through
a
*
<p>The default socket factory implementation performs
a
* three-tiered approach to creating client sockets. First, a direct
* three-tiered approach to creating client sockets. First, a direct
* socket connection to the remote VM is attempted. If that fails
* socket connection to the remote VM is attempted. If that fails
* (due to a firewall), the runtime uses HTTP with the explicit port
* (due to a firewall), the runtime uses HTTP with the explicit port
* number of the server. If the firewall does not allow this type of
* number of the server. If the firewall does not allow this type of
* communication, then HTTP to a cgi-bin script on the server is used
* communication, then HTTP to a cgi-bin script on the server is used
* to POST the RMI call.<p>
* to POST the RMI call.
*
* <p>The default socket factory implementation creates server sockets that
* are bound to the wildcard address, which accepts requests from all network
* interfaces.
*
* @implNote
* <p>You can use the {@code RMISocketFactory} class to create a server socket that
* is bound to a specific address, restricting the origin of requests. For example,
* the following code implements a socket factory that binds server sockets to the
* loopback address. This restricts RMI to processing requests only from the local host.
*
* <pre>{@code
* class LoopbackSocketFactory extends RMISocketFactory {
* public ServerSocket createServerSocket(int port) throws IOException {
* return new ServerSocket(port, 5, InetAddress.getLoopbackAddress());
* }
*
* public Socket createSocket(String host, int port) throws IOException {
* // just call the default client socket factory
* return RMISocketFactory.getDefaultSocketFactory()
* .createSocket(host, port);
* }
* }
*
* // ...
*
* RMISocketFactory.setSocketFactory(new LoopbackSocketFactory());
* }</pre>
*
* Set the {@code java.rmi.server.hostname} system property
* to a host name (typically {@code localhost}) that resolves to the loopback
* interface to ensure that the generated stubs use the right network interface.
*
*
* @author Ann Wollrath
* @author Ann Wollrath
* @author Peter Jones
* @author Peter Jones
...
...
src/share/classes/java/rmi/server/UnicastRemoteObject.java
浏览文件 @
d94ca2fd
/*
/*
* Copyright (c) 1996, 20
0
3, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 20
1
3, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -100,6 +100,26 @@ import sun.rmi.server.UnicastServerRef2;
...
@@ -100,6 +100,26 @@ import sun.rmi.server.UnicastServerRef2;
* </ul>
* </ul>
* </ul>
* </ul>
*
*
* <p>If an object is exported with the
* {@link #exportObject(Remote) exportObject(Remote)}
* or
* {@link #exportObject(Remote, int) exportObject(Remote, port)}
* methods, or if a subclass constructor invokes one of the
* {@link #UnicastRemoteObject()}
* or
* {@link #UnicastRemoteObject(int) UnicastRemoteObject(port)}
* constructors, the object is exported with a server socket created using the
* {@link RMISocketFactory}
* class.
*
* @implNote
* <p>By default, server sockets created by the {@link RMISocketFactory} class
* listen on all network interfaces. See the
* {@link RMISocketFactory} class and the section
* <a href="{@docRoot}/../platform/rmi/spec/rmi-server29.html">RMI Socket Factories</a>
* in the
* <a href="{@docRoot}/../platform/rmi/spec/rmiTOC.html">Java RMI Specification</a>.
*
* @author Ann Wollrath
* @author Ann Wollrath
* @author Peter Jones
* @author Peter Jones
* @since JDK1.1
* @since JDK1.1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录