Crisp Reading Notes on Latest Technology Trends and Basics

Java Remote Object Model

MS-Word format on this page

References

Overview

These notes assume the Reader is familiar with the “Remote Procedure Call – RPC” model.

  • The discussion centers around how to provide a “Distributed Object Model”.

Object Features

  1. Remote Method Invocations
    • Method invocations on objects across different JVMs
  2. Object Class Methods
    • The methods of the Object class – equals, hashCode, toString, clone, finalize
  3. Remote access and faults
    • Throwing RemoteException
    • Dynamic stubs and proxies

Remote Method Invocation Model

Interfaces and Objects

  1. Java has interfaces and objects
  2. For Remote invocations, Java defines RemoteInterface and RemoteObject classes.
  3. All clients are expected to use the Remote, or an interface extended from it.
    • This is a marker interface to convey that remote calls need to be invoked on the same
  4. The servers implement “Remote Objects” by extending RemoteObject class.

Stubs and Serialization

  1. For every call that is made, stubs on the client side
    • convert the object-calls to network protocol and vice-versa
  2. To allow for generic stubs to be written,
    • Java defines a standard Object Serialization format, to convert to the wire and vice-versa

Dynamic Stubs

For consistency between the server version and the server stubs,

  • The Java class-loader can load the stubs from an external URL. This could be the RMI server

Remote Exceptions

Every Remote Method must be declared to throw a RemoteException

  • This is to handle when there is a communication failure across systems.

Object Implementation

All Object methods need to be revisited for re-implementation under the new “Distributed Object Model”.

getClass Returns the stub-class. Requires no changes
hashCode Re-implemented to hash the ReferenceId – not “Content based”This is done to avoid a RPC for performance and integration reasons
equals Re-implemented to hash the ReferenceId – not “Content based”This is done to avoid a RPC for performance and integration reasons
clone Implemented to clone the reference
wait Lock on the local objectObject on server can be accessed by different clients
notify Unlock on local object
notifyAll Unlock on local object
toString Objectifies the string reference
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: