- java.lang.Object
-
- javax.management.remote.rmi.RMIServerImpl
-
- javax.management.remote.rmi.RMIJRMPServerImpl
-
- All Implemented Interfaces:
-
Closeable,AutoCloseable,Remote,RMIServer
public class RMIJRMPServerImpl extends RMIServerImpl
通过JRMP导出并通过JRMP导出的RMI对象创建客户端连接的一个
RMIServer对象。 用户代码通常不直接引用此类。- 从以下版本开始:
- 1.5
- 另请参见:
-
RMIServerImpl
-
-
构造方法摘要
构造方法 Constructor 描述 RMIJRMPServerImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf, Map<String,?> env)创建一个新的RMIServer对象,该对象将使用给定的套接字工厂在给定端口上导出。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected voidcloseClient(RMIConnection client)关闭由makeClient制作的客户端连接。protected voidcloseServer()由RMIServerImpl.close()调用,通过 取消导出该对象来关闭连接器服务器。protected voidexport()导出此RMI对象。protected StringgetProtocol()返回此对象的协议字符串。protected RMIConnectionmakeClient(String connectionId, Subject subject)创建一个新的客户端连接作为通过JRMP导出的RMI对象。RemotetoStub()返回此RMIServer对象的可序列存根。-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class javax.management.remote.rmi.RMIServerImpl
clientClosed, close, getDefaultClassLoader, getMBeanServer, getVersion, newClient, setDefaultClassLoader, setMBeanServer
-
-
-
-
构造方法详细信息
-
RMIJRMPServerImpl
public RMIJRMPServerImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf, Map<String,?> env) throws IOException创建一个新的
RMIServer对象,该对象将使用给定的套接字工厂在给定端口上导出。- 参数
-
port- 将导出此对象及其创建的RMIConnectionImpl对象的端口。 可以为零,表示任何可用的端口。 -
csf- 创建的RMI对象的客户端套接字工厂。 可以为null。 -
ssf- 创建的RMI对象的服务器套接字工厂。 可以为null。 -
env- 环境地图。 可以为null。 - 异常
-
IOException- 如果无法创建RMIServer对象。 -
IllegalArgumentException- 如果port是否定的。
-
-
方法详细信息
-
export
protected void export() throws IOException描述从类复制:RMIServerImpl导出此RMI对象。
- Specified by:
-
export在RMIServerImpl - 异常
-
IOException- 如果此RMI对象无法导出。
-
getProtocol
protected String getProtocol()
描述从类复制:RMIServerImpl返回此对象的协议字符串。 RMI / JRMP的字符串为
rmi。- Specified by:
-
getProtocol在RMIServerImpl - 结果
- 该对象的协议字符串。
-
toStub
public Remote toStub() throws IOException
返回此
RMIServer对象的可序列存根。- Specified by:
-
toStub在RMIServerImpl - 结果
- 一个可序列化的存根
- 异常
-
IOException- 如果无法获取存根 - 例如RMIJRMPServerImpl尚未导出。
-
makeClient
protected RMIConnection makeClient(String connectionId, Subject subject) throws IOException
创建一个新的客户端连接作为通过JRMP导出的RMI对象。 新的
RMIConnection对象的端口和插座工厂是提供给RMIJRMPServerImpl构造函数的端口和插座工厂。- Specified by:
-
makeClient在RMIServerImpl - 参数
-
connectionId- 新连接的ID。 此连接器服务器打开的每个连接将具有不同的ID。 如果此参数为空,则该行为是未指定的。 -
subject- 认证主题。 可以为null。 - 结果
-
新创
RMIConnection。 - 异常
-
IOException- 如果新的RMIConnection对象无法创建或导出。
-
closeClient
protected void closeClient(RMIConnection client) throws IOException
描述从类别复制RMIServerImpl关闭
makeClient建立的客户端连接。- Specified by:
-
closeClient在RMIServerImpl - 参数
-
client- 之前由makeClient返回的closeClient方法以前未被调用的连接。 如果违反这些条件,行为是未指定的,包括client为空的情况。 - 异常
-
IOException- 如果客户端连接不能关闭。
-
closeServer
protected void closeServer() throws IOException由
RMIServerImpl.close()调用,通过取消导出该对象来关闭连接器服务器。 从此方法返回后,连接器服务器不能接受任何新的连接。- Specified by:
-
closeServer在RMIServerImpl - 异常
-
IOException- 如果尝试关闭连接器服务器失败。
-
-