RPC Middleware Several different technologies support remote - - PowerPoint PPT Presentation

rpc middleware
SMART_READER_LITE
LIVE PREVIEW

RPC Middleware Several different technologies support remote - - PowerPoint PPT Presentation

RPC Middleware Several different technologies support remote procedure calls Java RMI DCOM CORBA Web Services .NET Remoting Dec. 2. 2005 CS 440 Lecture Notes 1 Why Call It Middleware? Supports implementation


slide-1
SLIDE 1
  • Dec. 2. 2005

CS 440 Lecture Notes 1

RPC Middleware

  • Several different technologies support

remote procedure calls

– Java RMI – DCOM – CORBA – Web Services – .NET Remoting

slide-2
SLIDE 2
  • Dec. 2. 2005

CS 440 Lecture Notes 2

Why Call It Middleware?

  • Supports implementation of the “middle”

tier of a three-tiered software architecture

  • Different paradigms

– Object-oriented RPC mechanism – Message-oriented middleware (MOM)

Client DB Server Business Logic

slide-3
SLIDE 3
  • Dec. 2. 2005

CS 440 Lecture Notes 3

Two-Tiered Architecture

  • Older architecture for distributed apps
  • Communication with DB server using

some sort of network protocol

– ODBC – JDBC – Proprietary from DB vendor

Client DB Server

slide-4
SLIDE 4
  • Dec. 2. 2005

CS 440 Lecture Notes 4

Java Remote Method Invocation (RMI)

  • Java’s mechanism for RPC

From http://www.aurorainfo.com/wp10/#6

slide-5
SLIDE 5
  • Dec. 2. 2005

CS 440 Lecture Notes 5

RMI (cont.)

  • API component – stub/skeleton layer

– Stub object

  • Local to client
  • Acts as surrogate for remote object

– Skeleton object

  • Local to server
  • Driver for calls to object on server

– Both generated from description of object’s interface

slide-6
SLIDE 6
  • Dec. 2. 2005

CS 440 Lecture Notes 6

RMI (cont.)

  • Presentation layer component - Remote

Reference Layer

– Responsible for marshalling / demarshalling parameters – Intercepts calls from stubs and directs into network interface – Directs calls from network interface to correct skeleton

slide-7
SLIDE 7
  • Dec. 2. 2005

CS 440 Lecture Notes 7

RMI (cont.)

  • Network interface component – Transport

Layer

– Any networking protocol supported by Java

  • So the Remote Reference Layer must

implement any RPC-specific networking functions (i.e. BLAST, CHAN, SELECT)

slide-8
SLIDE 8
  • Dec. 2. 2005

CS 440 Lecture Notes 8

Enterprise Java Beans (EJB)

  • Popular use for RMI in a three-tiered

architecture

From http://www.aurorainfo.com/wp10/#6

slide-9
SLIDE 9
  • Dec. 2. 2005

CS 440 Lecture Notes 9

EJBs (cont.)

  • Based on Java Beans

– Spec for designing a software component with a standard interface

  • Allows manipulation by development tools
  • EJBs must implement additional interfaces

which allow them to be managed by an EJB container or EJB application server

slide-10
SLIDE 10
  • Dec. 2. 2005

CS 440 Lecture Notes 10

EJBs (cont.)

  • Bean divided into two components

– Generic EJB object that implements interfaces required to interoperate with app server – Bean class extends generic object, implements actual business logic

  • Bean thus has two interfaces

– Home interface, used by app server – Remote interface, used by client

  • RMI based
slide-11
SLIDE 11
  • Dec. 2. 2005

CS 440 Lecture Notes 11

Java Naming and Directory Interface (JNDI)

  • Home interfaces for EJBs used to

generate home stubs

  • These are made available via JNDI
  • Client locates the home stub for a desired

EJB using JNDI, invokes create method

  • Server returns EJB object stub to client,

containing EJB interface (including bean methods)

slide-12
SLIDE 12
  • Dec. 2. 2005

CS 440 Lecture Notes 12

Common Object Request Broker Arch. (CORBA)

  • Set of specs developed by Object Management

Group (OMG)

– Consortium of over 700 developer, vendor, and end user groups

  • OMG created an Object Management

Architecture (OMA)

  • One component of OMA is the Object Request

Broker (ORB)

– Responsible for facilitating remote communications

slide-13
SLIDE 13
  • Dec. 2. 2005

CS 440 Lecture Notes 13

CORBA (cont.)

  • CORBA is the set of more detailed specifications

for the ORB

  • Main features:

– ORB Core – Interface Definition Language (IDL) – Interface Repository – Language Mappings – Stubs and Skeletons – Dynamic Invocation and Dispatch – Object Adapters – Inter-ORB protocols

slide-14
SLIDE 14
  • Dec. 2. 2005

CS 440 Lecture Notes 14

ORB Core

  • Similar in function to EJB app server
  • Deliver requests to objects, return

responses to clients

  • Hides details of object

– Location – Implementation (language, OS, hardware) – Execution state (active, suspended, deleted) – Communication mechanism

slide-15
SLIDE 15
  • Dec. 2. 2005

CS 440 Lecture Notes 15

OMG Interface Definition Language (IDL)

  • Standardized way of specifying object

interfaces

  • Language independent
  • Provides well-defined set of types

– Basic types like long, double, boolean – Constructed types like struct and union – Template types like sequence and string

slide-16
SLIDE 16
  • Dec. 2. 2005

CS 440 Lecture Notes 16

IDL (cont.)

  • Types used to define interfaces
  • IDL supports inheritance, so interfaces can be

defined that extend other interfaces

  • IDL also supports definition of exceptions
  • Example:

– module Stats { interface EUStats { string getMainLangs(in string countryname); long getPopulation(in string countryname); string getCapital(in string countryname); }; };

slide-17
SLIDE 17
  • Dec. 2. 2005

CS 440 Lecture Notes 17

Language Mappings

  • Use a tool to create stubs and skeletons

for a specific language from IDL

  • Defined mappings: Ada, C, C++, COBOL,

Java, LISP, Perl, PL/1, Python, Smalltalk, XML, COM bridge

  • Mapping CORBA to non-objected oriented

languages is difficult and cumbersome to use, but possible

slide-18
SLIDE 18
  • Dec. 2. 2005

CS 440 Lecture Notes 18

Stubs and Skeletons

  • Similar to those used byRMI
  • Stub is proxy or surrogate for remote
  • bject

– Responsible for marshalling/unmarshalling – Provides interface to ORB

  • Skeleton is driver for server side object
slide-19
SLIDE 19
  • Dec. 2. 2005

CS 440 Lecture Notes 19

Inter-ORB Protocols

  • Designed for interoperability

– Guarantee that IDL types and object references are consistent between different implementations

  • General InterORB Protocol (GIOP)

– Transport independent specification

  • Internet InterORB Protocol (IIOP)

– Specifies how GIOP is mapped to TCP/IP