public abstract class RemoteObject extends Object implements Remote, Serializable
RemoteObject类实现了远程对象的java.lang.Object行为。
RemoteObject通过实现hashCode,equals和toString的方法来提供Object的远程语义。
| Modifier | Constructor and Description |
|---|---|
protected |
RemoteObject()
创建一个远程对象。
|
protected |
RemoteObject(RemoteRef newref)
创建一个远程对象,使用指定的远程引用进行初始化。
|
protected transient RemoteRef ref
protected RemoteObject()
protected RemoteObject(RemoteRef newref)
newref - 远程参考
public RemoteRef getRef()
注意:从此方法返回的对象可能是实现特定类的实例。 RemoteObject类通过其自定义writeObject和readObject方法的行为确保其实例的远程引用的序列化writeObject 。 RemoteRef的实例不应该在其RemoteObject封装实例之外进行RemoteObject否则结果可能不可移植。
public static Remote toStub(Remote obj) throws NoSuchObjectException
obj传递的远程对象obj的存根。
此操作仅在导出对象后有效。
obj - 需要存根的远程对象
obj 。
NoSuchObjectException - 如果无法找到远程对象的存根。
public int hashCode()
public boolean equals(Object obj)
equals方法的结果进行equals 。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.