站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.4.1, Java 2 SDK 英文文档

Java Remote Method Invocation: 2 - Distributed Object Model - JDK 5 Documentation v1.4.1, Java 2 SDK 英文文档

CONTENTS | PREV | NEXT Java Remote Method Invocation


2.3 The Distributed and Nondistributed Models Contrasted

The Java platform's distributed object model is similar to the Java platform's object model in the following ways:

  • A reference to a remote object can be passed as an argument or returned as a result in any method invocation (local or remote).
  • A remote object can be cast to any of the set of remote interfaces supported by the implementation using the syntax for casting built into the Java programming language.
  • The built-in instanceof operator can be used to test the remote interfaces supported by a remote object.
The Java platform's distributed object model differs from the Java platform's object model in these ways:

  • Clients of remote objects interact with remote interfaces, never with the implementation classes of those interfaces.
  • Non-remote arguments to, and results from, a remote method invocation are passed by copy rather than by reference. This is because references to objects are only useful within a single virtual machine.
  • A remote object is passed by reference, not by copying the actual remote implementation.
  • The semantics of some of the methods defined by class java.lang.Object are specialized for remote objects.
  • Since the failure modes of invoking remote objects are inherently more complicated than the failure modes of invoking local objects, clients must deal with additional exceptions that can occur during a remote method invocation.


CONTENTS | PREV | NEXT
Copyright © 1997-2001 Sun Microsystems, Inc. All Rights Reserved.