Copyright (c) Qusay H. Mahmoud 1 The Naming Service (Client’s View) A tree-like directory for object references Much like a file system: provides directory.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Slides for Chapter 20: CORBA Case Study From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Addison-Wesley 2005.
Java IDL Callback Object. interface Listener { void message(in string msg); }; interface MessageServer { void register(in Listener lt); };
15-May-15 RMI Remote Method Invocation. 2 “The network is the computer” Consider the following program organization: If the network is the computer, we.
Advanced Programming Rabie A. Ramadan Lecture 4. A Simple Use of Java Remote Method Invocation (RMI) 2.
1 Distributed Systems Distributed Objects & Remote Invocation CORBA Dr. Sunny Jeong. Mr. Colin Zhang With Thanks.
CORBA IDL 1 Introduction to CORBA IDL Overview  OMG IDL is purely a descriptive language  OMG IDL obeys the same lexical rules as C++  OMG IDL grammar.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 11: CORBA.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Classes and Instances. Introduction Classes, Objects, Methods and Instance Variables Declaring a Class with a Method and Instantiating an Object of a.
IDL Interface Definition Language. IDL products Interface repository Dynamic Interface Static skeletons Client IDL stubs Dynamic skeletons Server Object.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 13: CORBA.
II. Middleware for Distributed Systems
Naming Service 1 Common Principles  Object-oriented middleware uses object references to address server objects  We need to find a way to get hold of.
By Dr. Jiang B. Liu 11. Java IDL and CORBA  Generic ORB Core  idltojava development tool  CORBA Object Service (COS) name service - nameserv  Java.
CORBA. A CORBA example From url: es/releases/corba/ The transient server example.
CORBA Chapter 17 Coulouris text. Today’s Topics CORBA History and goals CORBA RMI CORBA services The Distributed Whiteboard Revisited.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Programming with CORBA Hongtao Shi 04/23/01. §CORBA Overview §Advantages of CORBA §Interface Definition Language §Application: Address Book Outline.
1 Java Programming II Java Network II (Distributed Objects in Java)
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
Distributed Objects and Remote Invocation: RMI and CORBA Most concepts are drawn from Chapter 17 © Pearson Education Rajkumar Buyya, Xingchen Chu, Rodrigo.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 8: Distributed.
Information Management NTU Interprocess Communication and Middleware.
Slide 1 CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application ITONK1.
CS603 Distributed Object Systems March 27, Distributed Object Systems What are they? –CORBA –DCOM –Java/RMI But what does it mean? –RPC for the.
IBM TSpaces Lab 1 Introduction. Summary TSpaces Overview Basic Definitions Basic primitive operations Reading/writing tuples in tuplespace HelloWorld.
Client-Side Slice-to-Java Mapping Copyright © ZeroC, Inc. Ice Programming with Java 4. Client-Side Slice-to-Java Mapping.
Stacks. A stack is a data structure that holds a sequence of elements and stores and retrieves items in a last-in first- out manner (LIFO). This means.
CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) ( Specification.
CORBA – Command Line CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
MSc Course in Advanced Distributed Systems Session 2.2: Practical CORBA Programming
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
RMI Remote Method Invocation Distributed Object-based System and RPC Together 2-Jun-16.
CORBA Details Three Tier Architecture CORBA API Holders and Helpers COS Naming and Naming Contexts Transient and Persistent Objects Properties Callbacks.
Vakgroep Informatietechnologie - IBCN CORBA & RMI Design of Distributed Software.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
 Remote Method Invocation  A true distributed computing application interface for Java, written to provide easy access to objects existing on remote.
Slides for Chapter 17: CORBA Case Study From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley 2001.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Java Programming: Advanced Topics 1 Networking Programming Chapter 11.
CORBA – Eclipse CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
CORBA_1/001 Department of Computer Science Southern Illinois University Edwardsville Spring, 2010 Dr. Hiroshi Fujinoki CORBA:
1 Chapter 2 C++ Syntax and Semantics, and the Program Development Process.
Server-Side Java Mapping Copyright © ZeroC, Inc. Ice Programming with Java 6. Server-Side Java Mapping.
CMSC 341 Java Packages, Classes, Variables, Expressions, Flow Control, and Exceptions.
Remote Method Invocation with Java-RMI
1 Naming Service. 2 Naming service The CORBA COS (Common Object Services) Naming Service provides a tree- like directory for object references –It is.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
 Java RMI Distributed Systems IT332. Outline  Introduction to RMI  RMI Architecture  RMI Programming and a Sample Example:  Server-Side RMI programming.
Slide 1 of 15 © Ingeniørhøjskolen i Århus CORBA Programming: Presentation of a simple “Hello World” CORBA client and server application.
1 callback. 2 Client programs often react to changes or updates that occur in a server. For example, a client graph or spreadsheet program might need.
IDL Models The Inheritance Model: Using the Inheritance Model, you implement the IDL interface using an implementation class that also extends the compiler-generated.
CEN6502, Spring Understanding the ORB: Client Side Structure of ORB (fig 4.1) Client requests may be passed to ORB via either SII or DII SII decide.
Object-Oriented Middleware (OOMI) Locating Distributed Objects Emmerich – Chapter
CORBA Barış COŞKUN Çağatay DİKİCİ. INTRODUCTION Computer networks are heterogenous In 1989 OMG(Object Management Group) was formed to address the problems.
Only small steps in CORBA programming – much complexity
CORBA (Common Object Request Broker Architecture)
Remote Method Invocation
Java Programming Language
Govt. Polytechnic,Dhangar
Building a CORBA Server
Remote method invocation (RMI)
Exercises for Chapter 20: CORBA CASE STUDY
CORBA Programming B.Ramamurthy Chapter 3 5/2/2019.
Copyright © 2001 Qusay H. Mahmoud
Presentation transcript:

Copyright (c) Qusay H. Mahmoud 1 The Naming Service (Client’s View) A tree-like directory for object references Much like a file system: provides directory structure for files Object references are stored by name Each object reference-name pair is called a name binding Name bindings may be organized under naming contexts (name binding itself) All bindings are stored under initial naming context (the only persistent binding)

Copyright (c) Qusay H. Mahmoud 2 The Naming Service…. Your client’s ORB must know the name and port# of a host running the naming service The naming service can either be the JavaIDL naming service or any COS-compliant service To start: tnameserv –ORBInitialPort port# – The default port number is 900 To stop: use relevant OS command (kill, ctrl-c) Namespace is lost if name server halts/restarts

Copyright (c) Qusay H. Mahmoud 3 The Naming Service (interfaces) org.omg.CosNaming: – NamingContext: primary interface to naming service – NameComponent: identify (name/kind) services – BindingIterator: iterating through the contents – Binding: a single entry in the naming service – BindingList: a list of entries in the naming service – BindingType: the type of an entry

Copyright (c) Qusay H. Mahmoud 4 Naming Service (NamingContext) Analogous to a directory on a file system Contains a series of named objects An object in a NamingContext may be another NamingContext (analogous to subdirectory) A reference to the top level NamingContext can be obtained with the ORB method: resolve_initial_references()

Copyright (c) Qusay H. Mahmoud 5 Naming Service (NamingContext) To get a reference to an object stored under NamingContext, use: resolve(NameComponent namePath) It throws: NotFound, CannotProceed, InvalidName This method returns org.omg.CORBA.Object Therefore, it must be narrowed to a particular interface using a helper’s narrow()

Copyright (c) Qusay H. Mahmoud 6 Browsing the Naming Service The top level only…. import org.omg.CORBA.*; import org.omg.CosNaming.*; public class Browser { ORB orb = ORB.init (args, null); // obtain a reference to the naming service org.omg.CORBA.Object nc = orb.resolve_initial_references ("NameService"); NamingContext namingContext = NamingContextHelper.narrow (nc);

Copyright (c) Qusay H. Mahmoud 7 Browsing the Naming Service…. BindingListHolder b1 = new BindingListHolder (); BindingIteratorHolder b2 = new BindingIteratorHolder (); // get initial content-list namingContext.list (10, b1, b2); // print out bindings Binding[] bindings = b1.value; if(bindings.length == 0) return;

Copyright (c) Qusay H. Mahmoud 8 Browsing the Naming Service…. for (int i = 0; i < bindings.length; i++) { Binding binding = bindings[i]; NameComponent[] name = binding.binding_name; BindingType type = binding.binding_type; if (type == BindingType.nobject) { System.out.println (name[0].id + "-" + name[0].kind); } else { // BindingType.ncontext System.out.println (name[0].id + "-" + name[0].kind + "/"); }

Copyright (c) Qusay H. Mahmoud 9 CORBA Servers Implement the IDL interfaces by subclassing the appropriate pregenerated skeleton class Each class is called a servant The HelloServer Example (Slide 34) – Initialize the ORB – Create initial objects (servants) – Connect each servant to the ORB – Bind the servants in the naming service – Wait for connections

Copyright (c) Qusay H. Mahmoud 10 CORBA Servers (ObjectImpl) When a servant extends the _interfaceObjectImpl, it is actually extending the orb.omg.CORBA.Portable.ObjectImpl class This class provides a variety of helper methods (including all methods of CORBA Object)

Copyright (c) Qusay H. Mahmoud 11 Naming Service (Server’s View) Registering/Unregistering services: bind: register the object under the specified name rebind:identical to bind(), but an AlreadyBound exception won’t be thrown – existing object replaced unbind:unregister a CORBA object Creating new naming contexts: bind_new_context, new_context, bind_context Destroying a naming context: destroy: destroy an empty NamingContext

Copyright (c) Qusay H. Mahmoud 12 Clearing the Naming Service Steps: – Get a reference to initial naming context – Recursively iterate through the sub naming contexts – Call unbind – Call destroy

Copyright (c) Qusay H. Mahmoud 13 Advanced IDL IDL supports C/C++ style comments: // This is a comment /* This is another comment */ Also, it supports: – conditionals (#if) – defines (#define) – includes (#include) idlj requires access to a C preprocessor (cpp)

Copyright (c) Qusay H. Mahmoud 14 Advanced IDL: Arrays IDL provides multidimensional fixed-size arrays The array size is fixed at compile time IDL arrays map directly into Java arrays Example: interface Customer { attribute string address[4]; // 1-D array attribute short table[5][7]; // 2-D array }

Copyright (c) Qusay H. Mahmoud 15 Advanced IDL: Sequences A sequence is a 1-D array that can be of variable size Two types: – Bounded sequences sequence employee; – Unbounded sequences sequence employee

Copyright (c) Qusay H. Mahmoud 16 Advanced IDL: Enumerations The enum data type defines an enumeration – A user-defined data type that can hold one of a fixed set of values Example: enum CreditCard { visa, amex, discover }; interface Bank { void applyForCreditCard(CreditCard cc); };

Copyright (c) Qusay H. Mahmoud 17 Enumerations (mapping to Java) An enum is mapped to a Java class with static variables representing the set of values Example: public class CreditCard { public static final CreditCard visa, amex, discover; public static final int _visa, _amex, _discover; public int value(); } To compare (using switch): (unknown.value() == _visa)

Copyright (c) Qusay H. Mahmoud 18 Advanced IDL: Structures The IDL type struct defines a structure Use a struct to group related data together Example: struct Name { string firstName; string lastName; }; interface Customer { attribute Name name; };

Copyright (c) Qusay H. Mahmoud 19 Structures (mapping to Java) A struct is mapped to a Java class that provides instance variables for the fields, and a constructor for all values, and a null constructor Example: public class Name { public String firstName; public String lastname; public Name(); public Name(String firstName, String lastName); }

Copyright (c) Qusay H. Mahmoud 20 Advanced IDL: typedefs A typedef is an alias, or another name for an existing data type Example: typedef long age; interface Customer { age howOld; } Typedefs of simple data types are mapped to the original (I.e. replaced by the more basic type)

Copyright (c) Qusay H. Mahmoud 21 Advanced IDL: Constants 1. Within an interface: interface Foo { const long aLong = -32; }; Mapped to: public interface Foo { public static final int aLong = (int) –32L; }; 2. Not within an interface: const string Message=“hello”; Mapped to: public interface Message { public static final String Message=“hello”; };