java.lang.Object
javax.management.remote.rmi.RMIServerImpl
javax.management.remote.rmi.RMIJRMPServerImpl
- 所有已实现的接口:
-
Closeable,AutoCloseable,Remote,RMIServer
通过JRMP导出的一个RMIServer对象,创建客户端连接作为通过JRMP导出的RMI对象。用户代码通常不直接引用此类。
- 自 JDK 版本:
- 1.5
- 参见:
-
Constructor Summary
ConstructorsConstructorDescriptionRMIJRMPServerImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf, Map<String, ?> env) 创建一个新的RMIServer对象,将使用给定的端口和套接字工厂导出。 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseClient(RMIConnection client) 关闭由makeClient创建的客户端连接。protected void由RMIServerImpl.close()调用,通过取消导出此对象来关闭连接器服务器。protected voidexport()导出此RMI对象。protected String返回此对象的协议字符串。protected RMIConnectionmakeClient(String connectionId, Subject subject) 创建一个新的客户端连接,作为通过JRMP导出的RMI对象。toStub()返回此RMIServer对象的可序列化存根。Methods declared in class javax.management.remote.rmi.RMIServerImpl
clientClosed, close, getDefaultClassLoader, getMBeanServer, getVersion, newClient, setDefaultClassLoader, setMBeanServer
-
Constructor Details
-
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为负数。
-
-
Method Details
-
export
从类中复制的描述:RMIServerImpl导出此RMI对象。
- 指定者:
-
export在类RMIServerImpl - 抛出:
-
IOException- 如果无法导出此RMI对象。
-
getProtocol
从类中复制的描述:RMIServerImpl返回此对象的协议字符串。对于RMI/JRMP,该字符串为
rmi。- 指定者:
-
getProtocol在类RMIServerImpl - 返回:
- 此对象的协议字符串。
-
toStub
返回此
RMIServer对象的可序列化存根。- 指定者:
-
toStub在类RMIServerImpl - 返回:
- 一个可序列化存根。
- 抛出:
-
IOException- 如果无法获取存根,例如RMIJRMPServerImpl尚未导出。
-
makeClient
创建一个新的客户端连接,作为通过JRMP导出的RMI对象。新的
RMIConnection对象的端口和套接字工厂是提供给RMIJRMPServerImpl构造函数的端口和套接字工厂。- 指定者:
-
makeClient在类RMIServerImpl - 参数:
-
connectionId- 新连接的ID。由此连接器服务器打开的每个连接都将具有不同的ID。如果此参数为null,则行为未指定。 -
subject- 经过身份验证的主体。可以为null。 - 返回:
-
新创建的
RMIConnection。 - 抛出:
-
IOException- 如果无法创建或导出新的RMIConnection对象。
-
closeClient
从类中复制的描述:RMIServerImpl关闭由
makeClient创建的客户端连接。- 指定者:
-
closeClient在类RMIServerImpl - 参数:
-
client- 之前由makeClient返回的连接,在该连接上之前未调用closeClient方法。如果违反这些条件,包括client为null的情况,行为未指定。 - 抛出:
-
IOException- 如果无法关闭客户端连接。
-
closeServer
由
RMIServerImpl.close()调用,通过取消导出此对象来关闭连接器服务器。从此方法返回后,连接器服务器不得接受任何新连接。- 指定者:
-
closeServer在类RMIServerImpl - 抛出:
-
IOException- 如果尝试关闭连接器服务器失败。
-