0% found this document useful (0 votes)
23 views

Java Distributed Object System

RMI provides a distributed computing framework for Java that allows objects to be passed by reference between JVMs. It is based on Java's object model and provides features like distributed garbage collection. RMI uses stubs and skeletons with remote interfaces to enable remote method calls. Performance is improved compared to CORBA due to language and system homogeneity in RMI, but it is still less efficient than local method calls. JavaSpace provides an alternative distributed computing paradigm based on a reliable, global storage space for sharing objects.

Uploaded by

GURUMS
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Java Distributed Object System

RMI provides a distributed computing framework for Java that allows objects to be passed by reference between JVMs. It is based on Java's object model and provides features like distributed garbage collection. RMI uses stubs and skeletons with remote interfaces to enable remote method calls. Performance is improved compared to CORBA due to language and system homogeneity in RMI, but it is still less efficient than local method calls. JavaSpace provides an alternative distributed computing paradigm based on a reliable, global storage space for sharing objects.

Uploaded by

GURUMS
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

Java Distributed Object System

Main Module of a Distributed System


• Global address space
– global identifier
– registry/ name service ( central, distributed, replicated)
• Transportation system
• Global Control flow (Invocation/Control flow Protocol)
– parameter passing across address space
– method invocation semantic
– entity activation
• Failure Behavior
– exception
– consistency and persistency

1997.10.22 CS491 presented by Peng Wu 2


RMI Overview
RMI provides distributed computing ability on the
specific system(JVM) for the specific language(Java)
– CORBA, RPC
• System Heterogeneity
• Language Heterogeneity
– RMI based on homogeneity and strength it
• Language Integration -- distributed object model
– similar interface, preserve some behavior
– exception
• System Integration
– garbage collection
– mobile behavior
– security
1997.10.22 CS491 presented by Peng Wu 3
Language Integration -- Distributed Object
Model
Java Object model Distributed Object model
• Object • Remote object
• Interface object whose methods can be
declare a set of methods for accessed from another
Java object without address space
implementation • Remote interface
• Method Invocation an interface that declares the
– primitive type passed by methods of a remote object
value • Remote Implementation
– object passed by reference • RMI
non-remote object passed by
value
remote object passed by
reference

1997.10.22 CS491 presented by Peng Wu 4


RMI Interfaces and Classes

Object classes
Interfaces

Remote RemoteObject IOException

RemoteServer RemoteException
Client stub

... ...
UnicastRemoteObject
extension
implementation

1997.10.22 CS491 presented by Peng Wu 5


System Integration

• Distributed Garbage Collection


• Dynamic Stub loading
– specialized class loader
– security manager
– pickling system
• When marshalling remote object, marshal stream
embeds URL info of the stub code
• On demarshalling, marshal stream loads stub code if it’s
not available locally

1997.10.22 CS491 presented by Peng Wu 6


System Architecture

Application Client Server

Stubs Skeleton
RMI System Remote Reference layer
Transport

• Stub/Skeleton layer
• Remote reference layer
• Transport layer

1997.10.22 CS491 presented by Peng Wu 7


Distributed object Across Address Space
• Name Service
export export
Remote Remote
Server Server
registry registry

Locate Reg Locate Reg


naming naming client
client
binding binding

– URL based name lookup, no location transparency


– Non-persistent database
• java..rmi.registry.Registry
• java.rmi.LocateRegistry
• java.rmi.naming
1997.10.22 CS491 presented by Peng Wu 8
Distributed object Across Address Space

• Pickling -- Object transmission across address space


– Serialized representation of objects:
• object type
• object persistent state
• relationships between objects within a stream
• object implementation info
– Pickling remote object
• remote interface
• remote object reference

1997.10.22 CS491 presented by Peng Wu 9


RMI Performance
• RMI vs. Local call(PPro 200Mhz, NT, JDK no JIT)
RMI RMI local
(cross process) (cross machine)
Null 1.6 ms/call 1.8ms/call 700ns/call

Long[256] 6.5ms/call 7.6ms/call 800ns/call

• Call time (no configuration available)


– setup time: RMI 40% slower than CORBA
– binding: RMI 200-1500ms slower than CORBA
• CORBA vs. RMI
– 1000 calls, one argument, JDK1.1.1

1997.10.22 CS491 presented by Peng Wu 10


CORBA and RMI Performance
(1000 calls, one argument)

Time(sec)

80

70

60

50
IONA Orbix2.2(C++)
40 OrbixWeb 2.0.2(Java)
RMI(JD1.1.1)
30

20

10

0
0 int[24] int[240] struct[24] struct[240] parameter

1997.10.22 CS491 presented by Peng Wu 11


RMI Performance
• Scalability -- ability of handling multiple connections
to one remote object
– HelloImpl.sayHello() JDK1.1, Win95, 133-Pentium
• 150 threads in 2 sec interval, 200 threads in 5 sec
interval(RMI)
• 1000 threads(Java IDL)
• Serialization
– 100 times, default serialization, buffered stream, primitive
type, small array, small object array(10)
• RMI 64500ms (object)
• CORBA 3485ms (IDL struct)
– different serialization schemes
Object[1000], each 3 attributes(String, Double,util.Data)

1997.10.22 CS491 presented by Peng Wu 12


Performance of different serialization scheme
(Solaris2.5 Ultra-1 with attributes String, Double,Data)

5
relative rate

default serialization
4
partial serialization
full serialization
3
externalization

0
byte count create serialize deserialize

1997.10.22 CS491 presented by Peng Wu 13


Summary
Pros
• Integrating distribute object model seamlessly into
Java object model
• Homogeneity
• Communication with non-Java object may work
through JNI and JDBC
Cons
• Make distributed computing in Java easily to
approach, but not efficiently
• Heterogeneity
• A primitive implementation currently

1997.10.22 CS491 presented by Peng Wu 14


JavaSpace -- a new distributed computing
paradigm
• JavaSpace -- A reliable distributed storage system
• Goal -- facilitating cooperate distributed computing
• Utilization
– Distributed algorithms as flow of object
• establish connections between
participants(Client/Server, RPC, RMI)
– build interfaces and protocols between participants
• establish connections with a broker(JavaSpace)
– build interfaces and protocols with the broker
– Distributed persistence

1997.10.22 CS491 presented by Peng Wu 15


read
Identities Client
write

Write event JavaSpace

write
Client
Event
Dispatcher
notify Transaction take
write notify

JavaSpace
JavaSpace

1997.10.22 CS491 presented by Peng Wu 16


JavaSpace model
• Entry
basic unit of JavaSpace, a typed group of objects
• Template
a “partial” entry used to match entries with specific
properties
• Operation
– read
– write
– take
– notify

1997.10.22 CS491 presented by Peng Wu 17


A reliable distributed storage system
• Store and retrieve entries -- object
• Weak query ability
• Handle concurrent access
• Global control flow across multiple JavaSpaces
– asynchronous retrieval
– distributed transaction mechanism

1997.10.22 CS491 presented by Peng Wu 18

You might also like