Distributed Computing Object Oriented Middleware Part 1 Presented
Distributed Computing & Object Oriented Middleware: Part 1 Presented By Shawn Mulkey May 2, 2006 Shawn Mulkey - EECS 816 1
Agenda Introduction n Supporting Technologies n Remote Procedure Calls n CORBA n J 2 EE & RMI n Conclusion n May 2, 2006 Shawn Mulkey - EECS 816 2
Demonstration Interlude 1 May 2, 2006 Shawn Mulkey - EECS 816 3
Agenda n Introduction ¨ Definitions ¨ Usage ¨ CORBA, J 2 EE/RMI, . Net Supporting Technologies n Remote Procedure Calls n CORBA n J 2 EE & RMI n Conclusion n May 2, 2006 Shawn Mulkey - EECS 816 4
Definitions n Distributed Computing : A set of programs executing on one or more computers which coordinate actions by exchanging messages. Concurrent Execution n Independent Failure n May 2, 2006 Shawn Mulkey - EECS 816 5
Definitions n Middleware : Software components which promote extensibility and maintainability by employing abstraction between standardized interfaces. Behavior Semantics n Data Representation n May 2, 2006 Shawn Mulkey - EECS 816 6
Middleware Diagrams Local System Middleware Distributed System Middleware Server Application Process Middleware Network Comm System Resources Operating System Network Comm Middleware Application Hardware Resources Client May 2, 2006 Shawn Mulkey - EECS 816 7
Definitions n Remote Procedure Call: A protocol used by a program to request a service from another program without having to understand network or inter-process details. Client/Server based n Local procedure call semantics n May 2, 2006 Shawn Mulkey - EECS 816 8
Distributed Computing Usage n Distributed file systems n Mobile systems n Remote database access n Web based applications n Real-Time content distribution May 2, 2006 Shawn Mulkey - EECS 816 9
Distributed Computing Middleware n Object oriented middleware ¨ Extends RPC paradigm ¨ Uses OO design principles n Event based middleware ¨ Publish-Subscribe n systems Message oriented middleware ¨ General May 2, 2006 queuing model Shawn Mulkey - EECS 816 10
Distributed OO Middleware Platforms n Common Object Request Broker Architecture (CORBA) ¨ Canonical standard ¨ Extremely robust architecture ¨ Variable vendor implementation n Java RMI/J 2 EE ¨ RMI is object based RPC ¨ J 2 EE is a distributed object computing framework May 2, 2006 Shawn Mulkey - EECS 816 11
Distributed OO Middleware Platforms n Microsoft DCOM/. Net ¨ Proprietary distributed object technology ¨ Strong tool support ¨. Net intends complete integration n Web Services ¨ Based on open interoperable standards ¨ Strong industry and academic support ¨ Extensibility based on standardized semantics May 2, 2006 Shawn Mulkey - EECS 816 12
Agenda Introduction n Supporting Technologies n ¨ Application Stack ¨ Transport Protocols Remote Procedure Calls n CORBA n J 2 EE & RMI n Conclusion n May 2, 2006 Shawn Mulkey - EECS 816 13
Application Protocol Stack n Creates layered architecture n Between layers ¨ Standardized interfaces ¨ Standardized protocol ¨ Message encapsulation n Minimizes dependencies May 2, 2006 Shawn Mulkey - EECS 816 14
Application Protocol Stack Message Exit Message Enter Application Session Transport Network Data Link Physical Sender May 2, 2006 Router 1 Router 2 Shawn Mulkey - EECS 816 Recipient 15
Network Transport Protocols n Socket based n Communication protocols ¨ Packet sequencing ¨ Error recovery n TCP or UDP most common ¨ Connection n oriented vs. connectionless Addressing and routing ¨ Typically May 2, 2006 IP based Shawn Mulkey - EECS 816 16
Agenda n n n Introduction Supporting Technologies Remote Procedure Calls ¨ ¨ ¨ n n n RPC Introduction Architecture Protocol Error Handling Marshalling Asynchronous RPC CORBA J 2 EE & RMI Conclusion May 2, 2006 Shawn Mulkey - EECS 816 17
RPC Introduction n Application partitioned into ‘service’ and ‘client’ processes ¨ Either may be anonymous ¨ Service may be implemented as federation of processes n Difference between RPC and general client/server model ¨? RPC Follows semantics of local procedure call (LPC) May 2, 2006 Shawn Mulkey - EECS 816 18
RPC Introduction n Requires naming and binding ¨ Service lookup ¨ E. g. DNS, NIS, NFS n RPC service may or may not persist information ¨ Data replication ¨ Caching May 2, 2006 Shawn Mulkey - EECS 816 19
RPC Architecture n Service provider advertises interface or implements standardized interface ¨ Interface often defined in standardized language (IDL) ¨ Service may (or may not) also employ LPC semantics n Development framework provides connection and processing logic for services ¨ Framework may also provide naming directory for service binding May 2, 2006 Shawn Mulkey - EECS 816 20
RPC Architecture n Client executes ‘stub’ code to invoke remote service ¨ Stub hides connection and processing details ¨ Similar to macro expansion n Stub generator may be explicit or implicit ¨ Service provider may also execute against stub programs May 2, 2006 Shawn Mulkey - EECS 816 21
RPC Architecture Model Service Process Client Process Service Program Client Program Stub Procedure Request Comm Manager Dispatcher Comm Manager Response May 2, 2006 Shawn Mulkey - EECS 816 22
RPC Protocol n Request – Acknowledge / Response – Acknowledge ¨ Request Client must be processed exactly once Request Server Client Request Server Burst Ack Reply Ack May 2, 2006 Ack Shawn Mulkey - EECS 816 23
Demonstration Interlude 2 May 2, 2006 Shawn Mulkey - EECS 816 24
RPC Error Handling n Unique error types ¨ Binding error ¨ Server unavailable n Unknown failure origin ¨ Transparent n backup server use Unknown server state on failure ¨ Transactional May 2, 2006 semantics may be required Shawn Mulkey - EECS 816 25
Data Marshalling n Canonical data representation ¨ e. Xternal Data Representation (XDR) ¨ e. Xtensible Markup Language (XML) n Efficiency of processing vs. interoperability n Pointers complicate argument passing n Design tip: Use external types in application May 2, 2006 Shawn Mulkey - EECS 816 26
Asynchronous RPC Features n Synchronous semantics difficult to maintain ¨ Lack n of global clock Explicit asynchronous features useful ¨ Request only call ¨ Callbacks ¨ Event notification May 2, 2006 Shawn Mulkey - EECS 816 27
Agenda n n Introduction Supporting Technologies Remote Procedure Calls CORBA ¨ ¨ n n History & Introduction Components & Architecture Interface Definition Language Services J 2 EE & RMI Conclusion May 2, 2006 Shawn Mulkey - EECS 816 28
CORBA Introduction n Acronym: Common Object Request Broker Architecture ? n Development system addressing common RPC issues in an OO framework n Overtaken by newer technologies, but still standard reference model May 2, 2006 Shawn Mulkey - EECS 816 29
CORBA History n Advanced Network Systems Architecture (ANSA) early attempt at distributed system generalization ¨ Encouraged distributed objects design ¨ Applied as set of guidelines to design n approach Object Management Group (OMG) formed by vendors to promote interoperability between object systems ¨ System developed became CORBA ¨ Concrete tools over abstract ANSA specifications May 2, 2006 Shawn Mulkey - EECS 816 30
CORBA Features n Provides common distributed object architecture n Defines common syntax for data and interface definition n Primarily method of inter-system interoperability ¨ n Strong legacy system support Implementations and support in common languages C++ ¨ Java ¨ Many others ¨ May 2, 2006 Shawn Mulkey - EECS 816 31
CORBA Components n Entities ¨ Object references ¨ Abstract interface ¨ Basic types ¨ Constructed Types n Requests ¨ Operations on objects called by client on server ¨ May be one way May 2, 2006 Shawn Mulkey - EECS 816 32
CORBA Components n Object Request Broker (ORB) ¨ Matches n client request with servicing object Client stub ¨ Generated calling code implementing connection and marshaling logic n Server skeleton ¨ Generated May 2, 2006 code extended by server object Shawn Mulkey - EECS 816 33
Basic CORBA Architecture Have a nice day! Client Program Server Object Calling Stub Interface Skeleton Object Request Broker May 2, 2006 Shawn Mulkey - EECS 816 34
Interface Definition Language n Interface defined for client calls and server implementation n CORBA IDL not compiled ¨ Mapped to individual language constructs ¨ Not every language directly supports every IDL feature n Concrete implementations (stubs & skeletons) generated automatically May 2, 2006 Shawn Mulkey - EECS 816 35
Simple Interface Example interface salestax { float calculate_tax ( in float taxable_amount ); } n Note: ¨C like syntax ¨ Typed identifiers ¨ Procedural declarations May 2, 2006 Shawn Mulkey - EECS 816 36
IDL Syntax n Typed references and values ¨ Interfaces ¨ Constructed (structs, arrays, etc. ) ¨ Value Types ¨ Built-in (int, float, etc. ) n Scoped access ¨ ‘Module’ identifier ¨ Namespace semantics May 2, 2006 Shawn Mulkey - EECS 816 37
IDL Syntax n Parameter accessibility ¨ in ¨ out ¨ inout n Exceptions declared with ‘raises’ keyword n Not all semantics available through IDL ¨ Examples: security, lifecycle ¨ Often implemented with standardized object behavior May 2, 2006 Shawn Mulkey - EECS 816 38
Declaration Example module CORBA { interface Object { Interface. Def get_interface (); boolean is_nil(); Object duplicate (); void release (); boolean is_a (in string logical_type_id); boolean is_equivalent ( in Object other_object ); unsigned long hash( in unsigned long maximum); void create_request ( in Context ctx, in Identifier operation, in NVList arg_list, inout Named. Value result, out Request request, in Flags req_flag ); ………… }; }; May 2, 2006 Shawn Mulkey - EECS 816 39
Standard CORBA Services n ORB ¨ Encapsulates all server behavior n Load balancing n Server initialization and termination ¨ Performance customization ¨ Extended features possible n Naming ¨ Hierarchical object reference map ¨ Used by ORBs to locate objects or ¨ Names are symbol links to objects May 2, 2006 Shawn Mulkey - EECS 816 other ORBs 40
Optional CORBA Services n Event Notification Service (ENS) ¨ Publish/subscribe n n Register with topic – receive handle Asynchronous event delivery ¨ Long n pattern lived subscription requests Life-Cycle Service ¨ Factory for object creation ¨ Manages object copy, move & destruction ¨ Manages backups, repository organization etc. May 2, 2006 Shawn Mulkey - EECS 816 41
Optional CORBA Services n Transaction Service ¨ Concurrency control ¨ Synchronizes object actions ¨ Commit and abort semantics n Security Service ¨ Authentication ¨ Access control ¨ Non-repudiation May 2, 2006 Shawn Mulkey - EECS 816 42
CORBA Implementations n TAO / ACE ¨ Free and product versions ¨ Dr. Douglas Schmidt n Orbix ¨ Steven n Vinoski Visi. Broker ¨ Borland ¨ Feature rich ¨ Wide range of OS and language interopration May 2, 2006 Shawn Mulkey - EECS 816 43
Agenda n n n Introduction Supporting Technologies Remote Procedure Calls CORBA J 2 EE & RMI Introduction ¨ Java RMI ¨ J 2 EE ¨ n Conclusion May 2, 2006 Shawn Mulkey - EECS 816 44
RMI Introduction n Remote Method Invocation An explicit remote procedure call system which leverages the Java development framework to facilitate all aspects of RPC such as binding, transport and marshalling. May 2, 2006 Shawn Mulkey - EECS 816 45
RMI Implementation n Similar to CORBA semantics ¨ Requires name lookup service ¨ Requests serviced by remote components ¨ Parameter data types must be marshaled ¨ Exception system defined in specification n Each component implemented with Java technology May 2, 2006 Shawn Mulkey - EECS 816 46
RMI Implementation tools n rmiregistry – Server naming service n rmic – stub compiler n java. io. Serialization – Marshalling system n java. rmi. Remote – Base remoting interface n java. rmi. Remote. Exception – Base Remoting exception May 2, 2006 Shawn Mulkey - EECS 816 47
RMI Interfaces n Server and client components implement java. io. Remote interface May be extended with other interfaces ¨ Standard java interface and member declaration syntax as IDL ¨ n Example public interface Bank. Account extends java. rmi. Remote { public void deposit(float amount) throws java. rmi. Remote. Exception; public void withdraw(float amount) throws Overdrawn. Exception, java. rmi. Remote. Exception; public float get. Balance() throws java. rmi. Remote. Exception; } May 2, 2006 Shawn Mulkey - EECS 816 48
RMI Protocol 1) Server process begins 2) Server process registers one or more objects with the naming service 3) Client makes remote call against stub code 4) Stub code initiates TCP or HTTP stream connection with server process May 2, 2006 Shawn Mulkey - EECS 816 49
RMI Protocol 5) Server accepts connection and processes RPC 6) Server sends returns value or exception 7) Client stub marshals returned data to the calling procedure May 2, 2006 Shawn Mulkey - EECS 816 50
RMI Code Sample n RMI Interface public interface Receive. Message. Interface extends java. rmi. Remote { String transform. Message(String x) throws Remote. Exception; } May 2, 2006 Shawn Mulkey - EECS 816 51
public class Rmi. Server extends java. rmi. server. Unicast. Remote. Object implements Receive. Message. Interface { public void Rmi. Server() { try{ // create the registry and bind the name and object. java. rmi. Registry registry = Locate. Registry. create. Registry( 9999 ); registry. rebind("rmi. Server", this); } catch(Remote. Exception e) {. . . } } public String receive. Message(String x) throws Remote. Exception { return x. to. Upper(); } } May 2, 2006 Shawn Mulkey - EECS 816 52
public class Rmi. Client { static public void main(String args[]) { try{ // get the “registry” java. rmi. Registry registry = Locate. Registry. get. Registry(“somehost”, 9999); // look up the remote object Receive. Message. Interface rmi. Server = (Receive. Message. Interface)(registry. lookup("rmi. Server")); // call the remote method String result = rmi. Server. transform. Message(text); System. out. println(result); } catch(Remote. Exception e){ … } catch(Not. Bound. Exception e){ … } } } May 2, 2006 Shawn Mulkey - EECS 816 53
RMI Summary n Simple and efficient RPC system n Remote call semantics completely transparent to client and server n Implemented entirely with Java technology n Limited service support ¨ Security, May 2, 2006 life-cycle etc. Shawn Mulkey - EECS 816 54
J 2 EE Introduction n Java 2 Platform Enterprise Edition “A set of coordinated specifications and practices that together enable solutions for developing, deploying, and managing multitier server-centric applications. ” -Sun Microsystems, J 2 EE FAQ 2006 May 2, 2006 Shawn Mulkey - EECS 816 55
J 2 EE Muti-Tier Design n Client Tier ¨ ¨ n Web Tier ¨ ¨ n JSP Servlets Business Tier ¨ ¨ n Application process HTML Pages Domain Logic Enterprise Java Beans Enterprise Information System (EIS) Tier ¨ Database server May 2, 2006 Shawn Mulkey - EECS 816 56
J 2 EE Containers n Framework handling low-level details ¨ Connection management ¨ Transaction and state management n Promotes reusable application components ¨ Usually n called ‘beans’ Container presents API and runtime protocol for application beans May 2, 2006 Shawn Mulkey - EECS 816 57
J 2 EE Container Types n J 2 EE Server ¨ ¨ n Enterprise Java. Beans (EJB) Container ¨ n Manages EJB components Web Container ¨ ¨ n Running process Container for other servers HTTP server context Servlet & JSP Management Application/Applet Container ¨ ¨ Manages client environment Facilitates connections to the server components May 2, 2006 Shawn Mulkey - EECS 816 58
J 2 EE Container Hierarchy © Sun Microsystems, 2006 May 2, 2006 Shawn Mulkey - EECS 816 59
J 2 EE Services n Java Naming and Directory Interface (JNDI) n Enterprise Service. Beans API n Java Servlet API n Java. Server Pages (JSP) API n Java Messaging Service (JMS) May 2, 2006 Shawn Mulkey - EECS 816 60
J 2 EE Services n Java Transaction API n JDBC API n Java API for XML Processing & RPC n Java Authentication and Authorization Service May 2, 2006 Shawn Mulkey - EECS 816 61
Agenda n n n Introduction Supporting Technologies Remote Procedure Calls CORBA J 2 EE & RMI Conclusion Topic Summary ¨ Questions ¨ Looking Ahead ¨ May 2, 2006 Shawn Mulkey - EECS 816 62
Topic Summary n Distributed applications consist of multiple processes communicating via message passing n Remote Procedure Calls permit clients to request services from remote servers ¨ Uses n same semantics as local procedures Most RPC mechanisms have similar characteristics ¨ Name binding ¨ Data marshalling ¨ Exception handling May 2, 2006 Shawn Mulkey - EECS 816 63
Topic Summary n CORBA was first widely excepted OO RPC framework ¨ Established common architecture used by future distributed frameworks ¨ Created Interface Definition Language (IDL) to express service behavior and data descriptions ¨ Stubs and skeletons generators on various platforms to accommodate interoperability May 2, 2006 Shawn Mulkey - EECS 816 64
Topic Summary n Sun’s Java RMI (Remote Method Invocation) is Java specific PRC method ¨ Uses Java constructs for RPC management (e. g. naming, marshaling, etc. ) ¨ Simple and elegant architecture ¨ Generates ¨ Limited May 2, 2006 Java stubs and skeletons built-in services Shawn Mulkey - EECS 816 65
Topic Summary n Java 2 Enterprise Edition (J 2 EE) ¨ Framework ¨ Provides for distributed application development containers to handle low-level details ¨ Applications consist of relatively simple ‘beans’ which perform application specific logic ¨ Host of services available to facilitate distributed behavior May 2, 2006 Shawn Mulkey - EECS 816 66
Questions ? ? Who, What, Where, Why, How? ? May 2, 2006 ? Shawn Mulkey - EECS 816 ? 67
Looking Ahead n Microsoft. Net Technologies n SOAP Web Services n Grid Computing May 2, 2006 Shawn Mulkey - EECS 816 68
Distributed Computing & Object Oriented Middleware: Part 1 Thanks ! Shawn Mulkey May 2, 2006 Shawn Mulkey - EECS 816 69
- Slides: 69