30
Java Distributed Computing IS 313 3.6.2003

Java Distributed Computing

  • Upload
    arwen

  • View
    52

  • Download
    0

Embed Size (px)

DESCRIPTION

Java Distributed Computing. IS 313 3.6.2003. Outline. Quiz #4 Homework #3 Distributed computing overview Programming RMI. Homework #3. Good news Ave. 13.8 Bad news Some people didn’t turn in. Distributed computing. Sockets Messages from A to B Distributed computing - PowerPoint PPT Presentation

Citation preview

Page 1: Java Distributed Computing

Java Distributed Computing

IS 3133.6.2003

Page 2: Java Distributed Computing

Outline Quiz #4 Homework #3 Distributed computing overview Programming RMI

Page 3: Java Distributed Computing

Homework #3 Good news

Ave. 13.8 Bad news

Some people didn’t turn in

Page 4: Java Distributed Computing

Distributed computing Sockets

Messages from A to B Distributed computing

A is doing some computation P A asks B to compute some function F

Page 5: Java Distributed Computing

Sockets

Host

Application OS

Host

ApplicationOSSocket

Page 6: Java Distributed Computing

Distributed Computing

Server

Codebase

Client

Application

function F

Page 7: Java Distributed Computing

Questions to askHow does…1. P know how to call F2. P know that F resides on B3. P send its message to B and B send the answer back4. B handle F so it can be invokedWhen does5. The user/programmer of P have to know the answers to 1

and 2How does6. The system provide quality of service, security and

management

Page 8: Java Distributed Computing

Distributed comp. approaches (RPC) RMI DCOM CORBA/JIDL Web services

Page 9: Java Distributed Computing

RMI1. P and F are written in Java

F’s interface is available to P

2. Destination is an input3. Standard part of Java API4. RMI registry must be running on B5. (a) compile-time (b) run-time6. Not much

Page 10: Java Distributed Computing

RMI

Server

Java object

Client

Application

remote method

RMIregistry

Stub

Page 11: Java Distributed Computing

DCOM1. P and F are implemented in COM

A type library for F is available

2. Destination encoded in registry3. Part of Windows OS4. Loads and runs autonomously5. Standard answers6. Some MS tools

Page 12: Java Distributed Computing

DCOM

Server

COM object

Client

Application

public method

COM

COM

Page 13: Java Distributed Computing

CORBA1. An IDL description of F is available2. The ORB knows

inter-ORB communication

3. Request sent to ORB4. Destination ORB activates and runs5. Standard answers6. ORB vendors supply

Page 14: Java Distributed Computing

CORBA

Server

CORBA object

Client

Application

public method

ORB

ORB

Page 15: Java Distributed Computing

Web services1. P gets XML description of F2. Service registry knows3. HTTP/SOAP interaction4. web application server invokes F5. Both at run time6. Emerging

Page 16: Java Distributed Computing

Web services

Server

Object

Client

Application

public method

Webserver

SOAP

ServiceRegistry

Page 17: Java Distributed Computing

Trade-offs RMI

Java only DCOM

Windows only CORBA

Must by ORB software Web services

??

Page 18: Java Distributed Computing

Elements of an RMI application Remote object

contains the methods we want to call RMI server

a program that exposes the remote object RMI registry

built-in intermediary RMI client

program that accesses the remote object

Page 19: Java Distributed Computing

Remote Object Must implement a remote interface UnicastRemoteObject convenience class

Page 20: Java Distributed Computing

Remote Interface Remote object’s signature Must extend java.rmi.Remote All methods must throw RemoteException

Page 21: Java Distributed Computing

RMI Registry Distributed with the JDK No application-specific arguments

Page 22: Java Distributed Computing

RMI Server Program creates instance of Remote

Objects Names and publishes them in the registry Must set security policy to allow remote

connection

Page 23: Java Distributed Computing

RMI Client Compiled using the Remote Interface Contacts remote registry Downloads stub for remote object Calls methods on the stub

Page 24: Java Distributed Computing

Stub conforms to the remote interface, but connects to remote JVM marshals the parameters for F waits for the result of F, unmarshals the return value or exception

returned, and returns the value to the caller.

Page 25: Java Distributed Computing

Serialization Alternative to remote object Transmit the object itself Objects passed as parameters to remote

methods implement java.io.Serializable

no code necessary

Page 26: Java Distributed Computing

RMI Example WeatherInfo

serialized class IWeatherData

remote interface WeatherData

remote object WeatherServer

RMI server WeatherInfoClient

RMI client

Page 27: Java Distributed Computing

Deployment Distribute

remote interfaces definitions of serializable classes

Run rmic to generate stubs for remote objects

Run registry Run RMI server

Page 28: Java Distributed Computing

CORBA not “COBRA”! Common Object Request Broker

Architecture Language/platform-independent

distributed object computing

Page 29: Java Distributed Computing

Java IDL Similarities

Registry <--> ORB remote interface

Differences CORBA is not Java-specific Service brokering

Page 30: Java Distributed Computing

Process Write IDL Run idltojava

Creates Java interface Creates stubs Creates skeletons

Create remote object Implements IDL interface