|
CS 696 Emerging Technologies: Distributed Objects |
|
---|
Spring Semester, 1998
Some RMI System Architecture
To Lecture Notes Index
© 1998, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 21-Apr-98
Contents of Doc 16, Some RMI System Architecture
- References
- Architectural Overview
- Stub/Skeleton Layer
- Remote Reference Layer
- Transport Layer
- Threads in Remotes
- Bootstrapping the Client
- RMI Though Firewalls
- RMI and JDK 1.2
RMI Specification
JDK 1.2 beta Documentation
Stub
Forwards invocation requests to server objects
Initiating a call to the remote object
Marshaling arguments to a marshal stream
Informing the remote reference layer that the call should be invoke
Unmarshaling the return value or exception from a marshal stream
Informing the remote reference layer that the call is complete
Skeleton
Server-side entity that contains a method which dispatches calls to the actual
remote object implementation
Unmarshaling arguments from the marshal stream
Making the up-call to the actual remote object implementation
Marshaling the return value of the call or an exception onto the marshal
stream
Carries out the semantics of the invocation
For example the remote reference layer handles such items as:
- Whether the server is a single object or is a replicated object
-
- Whether the server is always running or is only run when called on
Setting up connections to remote address spaces
Managing connections
Monitoring connection liveness
Listening for incoming calls
Maintaining a table of remote objects that reside in the address space
Setting up a connection for an incoming call
Located the dispatcher for the target of the remote call and passing the
connection to this dispatcher
The transport layer uses the four basic abstractions
endpoint
- Abstraction used to denote an address space or java virtual
machine
channel
- Abstraction for a conduit between two address spaces
-
- Manages connections between the local address space and the remote address
space
connection
- Abstraction for transferring data
-
- Allows bi-directional multiplexing of multiple requests over one physical
connection for applets
transport
- Manages channels
-
- Accepts incoming connections
Let R be a remote object
Let C1 and C2 be two clients that call methods on R at the "same" time,
- They may or may not be calling the same method
If C1 and C2 are in the same virtual machines then the some calls to will be
handled in different threads on R and some calls will be handled in the same
thread
If C1 and C2 are in different virtual machines then the calls to will be
handled in different threads
- This means on object R will be accessed from different threads at the
"same" time
The last case is the only guarantee RMI makes about mapping remote object
invocations to threads
It is possible to download all the classes and interfaces needed by a client
application when you "run" the client
This requires the use of an http server
This is a very trick process the first time you do it
Much of the traffic on the RMI mailing list centers on getting this correct
The use of www-rohan make the process even harder
The bootstrap program can not directly reference the name for any client
classes, otherwise the classes will be loaded from the local machine
If an RMI request from a client hits a fire wall it will try to route through
http to a http server on port 80
I have not done this
See the RMI Specification for more details
Remote Method Invocation (RMI) has several new enhancements.
Remote Object Activation
- Persistent references to remote objects
- Automatic object activation via these references
Custom Socket Types
- A remote object can specify the custom socket type that RMI will use for
remote calls to that object.
- RMI over a secure transport (such as SSL) can be supported using custom
socket types.
Minor API Enhancements
- Unexporting a remote object
-
- Obtaining the stub for an object implementation
-
- Obtaining a local object implementation from a stub
-
- Exporting an object on a specific port.
visitors since 05-Mar-98