JavaTM 2 Platform
Standard Ed. 6

接口 java.rmi.Remote
的使用

使用 Remote 的软件包
java.rmi 提供 RMI 包。 
java.rmi.activation 为 RMI 对象激活提供支持。 
java.rmi.dgc 为 RMI 分布式垃圾回收提供了类和接口。 
java.rmi.registry 提供 RMI 注册表的一个类和两个接口。 
java.rmi.server 提供支持服务器端 RMI 的类和接口。 
javax.management.remote.rmi RMI 连接器是供 JMX Remote API 使用的一种连接器,后者使用 RMI 将客户端请求传输到远程 MBean 服务器。 
javax.rmi 包含 RMI-IIOP 的用户 API。 
javax.rmi.CORBA 包含用于 RMI-IIOP 的可移植性 API。 
org.omg.stub.java.rmi 包含用于 java.rmi 包中出现的 Remote 类型的 RMI-IIOP Stub。 
 

java.rmiRemote 的使用
 

返回 Remotejava.rmi 中的方法
static Remote Naming.lookup(String name)
          返回与指定 name 关联的远程对象的引用(一个 stub)。
 

参数类型为 Remotejava.rmi 中的方法
static void Naming.bind(String name, Remote obj)
          将指定 name 绑定到远程对象。
static void Naming.rebind(String name, Remote obj)
          将指定名称重新绑定到一个新的远程对象。
 

java.rmi.activationRemote 的使用
 

java.rmi.activationRemote 的子接口
 interface ActivationInstantiator
          ActivationInstantiator 负责创建“可激活”对象的实例。
 interface ActivationMonitor
          一个 ActivationMonitor 特定于一个 ActivationGroup,当一个组通过对 ActivationSystem.activeGroup 的调用(这是内部完成的)被报告为活动时,获得一个 ActivationMonitor
 interface ActivationSystem
          ActivationSystem 为注册组和在那些组中要被激活的“可激活”对象提供一种方式。
 interface Activator
          Activator 方便了远程对象激活。
 

实现 Remotejava.rmi.activation 中的类
 class Activatable
          Activatable 类为那些需要进行持久访问并能由系统激活的远程对象提供支持。
 class ActivationGroup
          ActivationGroup 负责创建组中“可激活”对象的新实例,在以下情况通知其 ActivationMonitor:它的对象变成活动的或者不活动的,或者整个组变成不活动的。
 class ActivationGroup_Stub
          ActivationGroup_Stub 是一个当作 java.rmi.server.UnicastRemoteObject 被导出的 java.rmi.activation.ActivationGroup 子类的 stub 类。
 

返回 Remotejava.rmi.activation 中的方法
 Remote ActivationID.activate(boolean force)
          激活此 id 的对象。
static Remote Activatable.exportObject(Remote obj, ActivationID id, int port)
          将可激活远程对象导出到 RMI 运行库中,使该对象能接收传入的调用。
static Remote Activatable.exportObject(Remote obj, ActivationID id, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          将可激活远程对象导出到 RMI 运行库中,使该对象能接收传入的调用。
static Remote Activatable.register(ActivationDesc desc)
          为可激活远程对象注册一个对象描述符,以便可以根据需要激活它。
 

返回变量类型为 Remote 的类型的 java.rmi.activation 中的方法
 MarshalledObject<? extends Remote> Activator.activate(ActivationID id, boolean force)
          激活与激活标识符 id 关联的对象。
 MarshalledObject<? extends Remote> ActivationInstantiator.newInstance(ActivationID id, ActivationDesc desc)
          激活程序调用一个初始化程序的 newInstance 方法,以便在该组中重建具有激活标识符 id 和描述符 desc 的对象。
 

参数类型为 Remotejava.rmi.activation 中的方法
abstract  void ActivationGroup.activeObject(ActivationID id, Remote obj)
          当对象被导出时(通过 Activatable 对象的构造或者通过显式调用 Activatable.exportObject),组的 activeObject 方法被调用。
static Remote Activatable.exportObject(Remote obj, ActivationID id, int port)
          将可激活远程对象导出到 RMI 运行库中,使该对象能接收传入的调用。
static Remote Activatable.exportObject(Remote obj, ActivationID id, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          将可激活远程对象导出到 RMI 运行库中,使该对象能接收传入的调用。
static ActivationID Activatable.exportObject(Remote obj, String location, MarshalledObject<?> data, boolean restart, int port)
          注册指定对象的激活描述符(使用指定的位置、数据和重启模式),并使用指定的端口输出该对象。
static ActivationID Activatable.exportObject(Remote obj, String location, MarshalledObject<?> data, boolean restart, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          注册指定对象的激活描述符(使用指定的位置、数据和重启模式),并使用指定的端口、指定的客户端和服务器套接字工厂输出该对象。
static boolean Activatable.unexportObject(Remote obj, boolean force)
          从 RMI 运行库中移除远程对象 obj。
 

类型变量类型为 Remotejava.rmi.activation 中的方法参数
protected  void ActivationGroup.activeObject(ActivationID id, MarshalledObject<? extends Remote> mobj)
          如果子类要进行对组监视器的 activeObject 回调,则此 protected 方法是必要的。
 void ActivationMonitor.activeObject(ActivationID id, MarshalledObject<? extends Remote> obj)
          通知某个对象现在是活动的。
 

java.rmi.dgcRemote 的使用
 

java.rmi.dgcRemote 的子接口
 interface DGC
          DGC 抽象用于分布式垃圾回收算法的服务器端。
 

java.rmi.registryRemote 的使用
 

java.rmi.registryRemote 的子接口
 interface Registry
          Registry 是简单远程对象注册表的一个远程接口,它提供存储和获取绑定了任意字符串名称的远程对象引用的方法。
 

返回 Remotejava.rmi.registry 中的方法
 Remote Registry.lookup(String name)
          返回注册表中绑定到指定 name 的远程引用。
 

参数类型为 Remotejava.rmi.registry 中的方法
 void Registry.bind(String name, Remote obj)
          绑定对此注册表中指定 name 的远程引用。
 void Registry.rebind(String name, Remote obj)
          用提供的远程引用替换此注册表中指定的 name 绑定。
 

java.rmi.serverRemote 的使用
 

实现 Remotejava.rmi.server 中的类
 class RemoteObject
          该 RemoteObject 类实现远程对象的 java.lang.Object 行为。
 class RemoteObjectInvocationHandler
          与 Java Remote Method Invocation(Java 远程方法调用,即 Java RMI)一起使用的 InvocationHandler 接口的实现。
 class RemoteServer
          该 RemoteServer 类是服务器实现的公共超类,并提供支持大量远程引用语义的框架。
 class RemoteStub
          该 RemoteStub 类是客户机 stub 的公共超类,并提供支持大量远程引用语义的框架。
 class UnicastRemoteObject
          用于导出带 JRMP 的远程对象和获得与该远程对象通信的 stub。
 

返回 Remotejava.rmi.server 中的方法
static Remote UnicastRemoteObject.exportObject(Remote obj, int port)
          使用提供的特定端口导出远程对象,以便能够接收传入的调用。
static Remote UnicastRemoteObject.exportObject(Remote obj, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          使用由给定的套接字工厂指定的传送方式导出远程对象,以便能够接收传入的调用。
static Remote RemoteObject.toStub(Remote obj)
          返回作为参数传递的远程对象 obj 的 stub。
 

参数类型为 Remotejava.rmi.server 中的方法
 void Skeleton.dispatch(Remote obj, RemoteCall theCall, int opnum, long hash)
          已过时。 无替代版本
static RemoteStub UnicastRemoteObject.exportObject(Remote obj)
          使用匿名端口导出远程对象,以便能够接收传入的调用。
static Remote UnicastRemoteObject.exportObject(Remote obj, int port)
          使用提供的特定端口导出远程对象,以便能够接收传入的调用。
static Remote UnicastRemoteObject.exportObject(Remote obj, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          使用由给定的套接字工厂指定的传送方式导出远程对象,以便能够接收传入的调用。
 RemoteStub ServerRef.exportObject(Remote obj, Object data)
          为提供的 Remote 对象创建客户机 stub 对象。
 Object RemoteRef.invoke(Remote obj, Method method, Object[] params, long opnum)
          调用某个方法。
static Remote RemoteObject.toStub(Remote obj)
          返回作为参数传递的远程对象 obj 的 stub。
static boolean UnicastRemoteObject.unexportObject(Remote obj, boolean force)
          从 RMI 运行时移除远程对象 obj。
 

javax.management.remote.rmiRemote 的使用
 

javax.management.remote.rmiRemote 的子接口
 interface RMIConnection
          RMI 对象,用于将 MBeanServer 请求从客户端转发到其位于服务器端的 MBeanServer 实现。
 interface RMIServer
          用于建立到 RMI 连接器的连接的 RMI 对象。
 

实现 Remotejavax.management.remote.rmi 中的类
 class RMIConnectionImpl
          RMIConnection 接口的实现。
 class RMIConnectionImpl_Stub
           
 class RMIIIOPServerImpl
          一个 RMIServerImpl,它通过 IIOP 导出,并可创建如同由 IIOP 导出的 RMI 对象的客户端连接。
 class RMIJRMPServerImpl
          一个 RMIServer 对象,它通过 JRMP 导出,并可创建如同由 JRMP 导出的 RMI 对象的客户端连接。
 class RMIServerImpl
          表示连接器服务器的 RMI 对象。
 class RMIServerImpl_Stub
           
 

返回 Remotejavax.management.remote.rmi 中的方法
 Remote RMIIIOPServerImpl.toStub()
          返回一个 IIOP stub。
 Remote RMIJRMPServerImpl.toStub()
          返回此 RMIServer 对象的可序列化的 stub。
abstract  Remote RMIServerImpl.toStub()
          返回此服务器对象的可远程化的 stub。
 

javax.rmiRemote 的使用
 

返回 Remotejavax.rmi 中的方法
static Remote PortableRemoteObject.toStub(Remote obj)
          返回给定服务器对象的 stub。
 

参数类型为 Remotejavax.rmi 中的方法
static void PortableRemoteObject.connect(Remote target, Remote source)
          使 Remote 对象准备好进行远程通信。
static void PortableRemoteObject.exportObject(Remote obj)
          准备服务器对象,以接收远程调用。
static Remote PortableRemoteObject.toStub(Remote obj)
          返回给定服务器对象的 stub。
static void PortableRemoteObject.unexportObject(Remote obj)
          从运行时注销服务器对象,允许对象用于垃圾回收。
 

javax.rmi.CORBARemote 的使用
 

返回 Remotejavax.rmi.CORBA 中的方法
 Remote Tie.getTarget()
          返回此 tie 的目标。
 Remote PortableRemoteObjectDelegate.toStub(Remote obj)
          PortableRemoteObject.toStub(java.rmi.Remote) 的委托调用。
 

参数类型为 Remotejavax.rmi.CORBA 中的方法
 void PortableRemoteObjectDelegate.connect(Remote target, Remote source)
          PortableRemoteObject.connect(java.rmi.Remote, java.rmi.Remote) 的委托调用。
 void PortableRemoteObjectDelegate.exportObject(Remote obj)
          PortableRemoteObject.exportObject(java.rmi.Remote) 的委托调用。
static Tie Util.getTie(Remote target)
          返回给定目标对象的 tie(如果存在)。
 Tie UtilDelegate.getTie(Remote target)
          Util.getTie(java.rmi.Remote) 的委托调用。
static void Util.registerTarget(Tie tie, Remote target)
          为 tie 注册一个目标。
 void UtilDelegate.registerTarget(Tie tie, Remote target)
          Util.registerTarget(javax.rmi.CORBA.Tie, java.rmi.Remote) 的委托调用。
 void Tie.setTarget(Remote target)
          由 Util.registerTarget(javax.rmi.CORBA.Tie, java.rmi.Remote) 调用以设置此 tie 的目标。
 Remote PortableRemoteObjectDelegate.toStub(Remote obj)
          PortableRemoteObject.toStub(java.rmi.Remote) 的委托调用。
 void PortableRemoteObjectDelegate.unexportObject(Remote obj)
          PortableRemoteObject.unexportObject(java.rmi.Remote) 的委托调用。
static void Util.unexportObject(Remote target)
          从内部表中移除关联的 tie,并调用 Tie.deactivate() 以取消激活该对象。
 void UtilDelegate.unexportObject(Remote target)
          Util.unexportObject(java.rmi.Remote) 的委托调用。
 

org.omg.stub.java.rmiRemote 的使用
 

实现 Remoteorg.omg.stub.java.rmi 中的类
 class _Remote_Stub
          此类为 Remote 类型提供 Stub。
 


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only