CIS 6930-01 – Fall 2000

12/12/2000


Click here to start


Table of Contents

CIS 6930-01 – Fall 2000

Remote Method Invocation

Example

Central Components of Java RMI

Some Supporting Technologies

Related Approaches to Networking

References

Getting Started

The Remote Interface

A Simple Example

java.rmi.Remote

java.rmi.RemoteException

The Remote Object

A Remote Object Implementation Class

Remarks

Compiling the Remote Object Class

Client and Server Programs

A Server Program

Remarks

A Client Program

Remarks

Compiling and Running the Example

Running HelloClient/HelloServer

Running HelloClient/HelloServer

Running HelloClient/HelloServer

Running HelloClient/HelloServer

Running HelloClient/HelloServer

Remark on Using the RMI Registry

The Mechanics of Remote Method Invocation

Is RMI a Language Extension?

Exchanging Remote References

Example: a Printer Directory

Remote References have Interface Type

Stubs

Some Important Parts of RMI

Architecture

The Role of rmic

Example Operation of rmic

The Generated Stub Class

Remarks on the Stub Class

Marshalling of Arguments

Object Serialization

I/O Streams

Object Streams

Using Object Streams

Serialization Preserves Object Graphs

Serializing and Deserializing a Tree

Referential Integrity is Preserved

The Serializable Interface

Argument Passing in RMI

Passing by Remote Reference

Argument Passing Examples

Example: a File Reading Service

The Remote Interface

The Remote Object Implementation

The Server Program

The Client Program

Compiling

Running FileClient/FileServer

Running FileClient/FileServer

Remarks

Example: The RMI Registry

The RMI Registry

The Registry Remote Interface

The LocateRegistry Class

Using the Registry Interface Directly

Passing a Remote Object Argument

Summary

Dynamic Class Loading

Byte Code Instructions for Stubs?

Serialization Only Saves the Data

Copying Stub Class Files

Dynamic Class Loading

Dynamic Class Loading

Remarks

The java.rmi.server.codebase Property

Properties

Setting the Code-base

Recap: Marshalling and the Code-base

Recap: Unmarshalling and Loading

Security Managers

Setting the Security Manager

Defining a Security Policy

The java.security.policy Property

Using Dynamic Loading

Anything that Can Go Wrong Will!

Tips for Dynamic Class Loading

Problems with the Registry

Empty CLASSPATH for the Registry

Using An “Internal” Registry

Collecting Things Together

The Server Program

Remarks

A Client Program

Remarks

Deployment

Running FileClient/FileServer

Running FileClient/FileServer

Running FileClient/FileServer

Running FileClient/FileServer

Remarks

Applets

Applets

Applets Today

Applets in this Course

Writing Applets is Easy (if . . .)

Applet Security Policies

Example: Application to Applet

The FileDisplay class

The FilePanel class

Conversion to an Applet

A First Attempt at an Applet Class

Compiling the Applet

Create an HTML File

Convert the HTML for the Plug-in

Make Sure the HTML is Visible!

Installing the Java Plug-in

Attempting to View the Applet

Adding a File Reading Service

An Updated File Server Program

An Updated Client

Deploying the Service

Class Loading in the Example

Running Server Programs in UNIX

What Did this Achieve?

Some Additional Features of Applets

Life Cycle of an Applet

Applet Parameters

An Improved Applet

An Improved Applet

stop()

Other Applications of RMI

Beyond Simple Client/Server

Example: Exploiting Dynamic Loading

A Generic Service

Example: Jini

Example: Call-backs

Server Remote Interface

Client Remote Interface

A Group of Interacting Objects

Sketch of Server Implementation

Sketch of Client Implementation

Synchronization

Garbage Collection

Author: Neil Jasper

Email: dbc@csit.fsu.edu

Home Page: http://aspen.csit.fsu.edu/it1fall00