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.

Slides:



Advertisements
Similar presentations
Slides for Chapter 20: CORBA Case Study From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Addison-Wesley 2005.
Advertisements

Java IDL Callback Object. interface Listener { void message(in string msg); }; interface MessageServer { void register(in Listener lt); };
1 Distributed Telecommunications Systems Columbia University comet.columbia.edu/distributed OmniORB II Michael E. Kounavis Dept. of Electrical Engineering.
Java Review Interface, Casting, Generics, Iterator.
15 May, 2015 CORBA Object-by-Value An overview of the value type and its IDL-to-C++ mapping. George Edwards Institute for Software-Integrated Systems Vanderbilt.
CORBA Architecture Nitin Prabhu. Outline CORBA Object Model CORBA Architecture Static Invocation Dynamic Invocation CORBA Communication Model.
© City University London, Dept. of Computing Distributed Systems / Distributed Systems Session 7: Naming and Trading Christos Kloukinas Dept. of.
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.
Designing a Database Unleashing the Power of Relational Database Design.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 13: CORBA.
II. Middleware for Distributed Systems
By Dr. Jiang B. Liu 11. Java IDL and CORBA  Generic ORB Core  idltojava development tool  CORBA Object Service (COS) name service - nameserv  Java.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 8: Naming, Trading and Lifecycle Services Computer Science & Engineering.
CORBA Chapter 17 Coulouris text. Today’s Topics CORBA History and goals CORBA RMI CORBA services The Distributed Whiteboard Revisited.
Fundamentals of Python: From First Programs Through Data Structures
CORBA Programming Using ACE/TAO
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Corso di Formazione Sodalia “Enterprise Java Beans” JNDI Java Naming and Directory Interface.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 8: Distributed.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
Polymorphism, Inheritance Pt. 1 COMP 401, Fall 2014 Lecture 7 9/9/2014.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Information Management NTU Interprocess Communication and Middleware.
CS551 - Lecture 17 1 CS551 Object Oriented Middleware (VI) Advanced Topics (Chap of EDO) Yugi Lee STB #555 (816)
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.
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
CS603 Distributed Object Systems March 27, Distributed Object Systems What are they? –CORBA –DCOM –Java/RMI But what does it mean? –RPC for the.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Abhishek Bachchan Vishal Patangia
CORBA – Command Line CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Copyright 2004 Scott/Jones Publishing Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 7 Structured Data and Classes.
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.
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.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
CORBA Common Object Request Broker Architecture. Basic Architecture A distributed objects architecture. Logically, an object client makes method calls.
DEVS Based Modeling and Simulation of the CORBA POA F. Bernardi, E. de Gentili, Pr. J.F. Santucci {bernardi, gentili, University.
CORBA – Eclipse CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Simple Classes. ADTs A specification for a real world data item –defines types and valid ranges –defines valid operations on the data. Specification is.
CORBA_1/001 Department of Computer Science Southern Illinois University Edwardsville Spring, 2010 Dr. Hiroshi Fujinoki CORBA:
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.
Portable Object Adaptor
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
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.
Towards a Naming & Binding Framework for ObjectWeb Sacha Krakowiak Univ. of Grenoble & INRIA.
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
Copyright © 2004, Keith D Swenson, All Rights Reserved. OASIS Asynchronous Service Access Protocol (ASAP) Tutorial Overview, OASIS ASAP TC May 4, 2004.
IDL Models The Inheritance Model: Using the Inheritance Model, you implement the IDL interface using an implementation class that also extends the compiler-generated.
1 Chapter 4 Unordered List. 2 Learning Objectives ● Describe the properties of an unordered list. ● Study sequential search and analyze its worst- case.
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.
Abstract Factory Pattern
Distribution and components
CORBA (Common Object Request Broker Architecture)
Abstract Factory Pattern
Ch > 28.4.
CORBA Object-by-Value
CORBA Object-by-Value
Remote method invocation (RMI)
JINI ICS 243F- Distributed Systems Middleware, Spring 2001
Exercises for Chapter 20: CORBA CASE STUDY
CORBA Programming B.Ramamurthy Chapter 3 5/2/2019.
Presentation transcript:

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 these object references without assuming physical locations  A name is a sequence of character strings that can be bound to an object reference  A name binding can be resolved to obtain the object reference

Naming Service 2 Common Principles  There may be many server objects in a distributed object system  Server objects may have several names  Leads to large number of name bindings  Name space has to be arranged in a hierarchy to avoid  Name clashes  Poor performance when binding/resolving names  Hierarchy achieved by naming contexts

Naming Service 3 Common Principles: Naming Contexts Cup Winners Cup Winners 1.FC Kaiserslautern 1.FC Kaiserslautern Premier First Man United Chelsea QPR South End United South End United England Germany 1. Liga 2. Liga BVB Bayern Bochum Lautern UEFA Manchester United Manchester United

Naming Service 4 Common Principles: Composite Names  Names are composed of possibly more than one component  Used to describe traversals across several naming contexts  Example: ("UEFA","England","Premier","Chelsea").

Naming Service 5 Common Principles: Name Server Behaviour  Name bindings are managed by name servers  Not every server object needs a name  Server objects may have several names (aliases)  Name servers must store bindings persistently  Name servers should be tuned towards efficiently resolving name bindings  Name server may itself be distributed

Naming Service 6 CORBA Naming Service  Supports bindings of names to CORBA object references.  Names are scoped in naming contexts.  Multiple names can be defined for object references.  Not all object references need names.  The CORBA naming service is used by  Clients to locate CORBA objects  Servers to advertise specific CORBA objects  Bootstrap service, enabling clients to find other services  Facilitate the initial connections between clients and servers  Basic function: association of names with object references

Naming Service 7  Server creates associations between names and object references for the CORBA objects (object binding)  Client retrieve the object references by querying the naming service and using the name as the key.  NS: a database of object bindings

Naming Service 8 Client Server 1. Create binding 2. resolve 3. Use target object

Naming Service 9 Binding Hierarchy  Context binding: an association between a name and a naming context  Object binding: an association between a name and an object reference Initial Naming Service London. region New_York.region Frankfurt.region Bankup.failover Main.failover StockExchange BrokerService

Naming Service 10 Components of a Stringified Name Stringified NameBinds to Empty stringInitial naming context London.regionNaming context London.region/Main.failoverNaming context London.region/Main.failover/StockExchangeObject reference  Initial naming context is always present and serves as the entry point to the naming service

Naming Service 11 CORBA Names  Names are composed of simple names.  Simple names are value-kind pairs.  Value attribute is used for resolving names.  Kind attribute is used to provide information about the role of the object.

Naming Service 12 CORBA Name  Name has two format:  Stringified name format: intuitive format that is easy to read and pass from place to place London.region/Main.failover/StockExchange  Raw name format: defined in terms of IDL complex types and can be used only within a CORBA program Module CosNaming { typedef string Istring; struct NameComponent { Istring id; Istring kind; }; typedef sequence Name; … };

Naming Service 13 CORBA Name  Kind field is intended to describe how a name component is used (similar to the file extension, client.exe)  Special cases:  empty kind field (omitting kind and kind separator “.”)  Empty id field (starting the name component with “.”)  Empty id field and empty kind field (denoted by “.”)  Example:././.

Naming Service 14 The IDL Interfaces  Naming Service is specified by two IDL interfaces:  NamingContext defines operations to bind objects to names and resolve name bindings.  BindingInterator defines operations to iterate over a set of names defined in a naming context.

Naming Service 15 Binding Module cosNaming{ enum BindingType{nobject, ncontext}; struct Binding{ Name binding_name; BindingType binding_type; }; typedef sequence BindingList; };

Naming Service 16 Binding and Unbinding Operations Module cosNaming{ interface NamingContext{ void bind(in Name n, in Object obj) raise(NotFound, InvalidName, AlreadyBound, CannotProceed); void rebind( in Name n, in Object obj) raise(NotFound, InvalidName, CannotProceed); void bind_context(in Name n, in NamingContext nc) raise(NotFound, InvalidName, AlreadyBound, CannotProceed); void rebind_context(in Name n, in NamingContext nc) raise(NotFound, InvalidName, CannotProceed); void unbind(in Name n) raise(NotFound, InvalidName, CannotProceed); };

Naming Service 17 bind() and rebind()  Both operations create an object binding that associates the name n (in raw format) with the naming context nc.  Rebind(): it creates a new object binding for the given name n or if a binding already exists with that name, overwrites the existing binding.  Bind(): it creates a new object binding for the given name n as long as there is no existing binding with that name. If a binding already exists, an AlreadyBound exception is thrown.  These operations create object bindings relative to the naming context on which they are invoked.  Example: A/B/C/MyObj on initial naming context, or MyObj on A/B/C naming context

Naming Service 18 bind_context() and rebind_context()  Parameter is context  Similar semantics as bind() and re_bind()

Naming Service 19 Create Context Module cosNaming{ //interface NamingContext{ NamingContext new_context(); NamingContext bind_new_context(in Name n); raise(NotFound, InvalidName, AlreadyBound, CannotProceed); //}; };  A naming context can be created (new_context()) and then be binded (bind_context())  Bind_new_context() creates a new context and binds it as a subcontext of the context on which the operation is invoked.

Naming Service 20 Before Binding Context1 Context5Context4 Context3Context2

Naming Service 21 After Binding Context1 Context5Context4 Context3Context2 MyName IOR of Object

Naming Service 22 Naming Scenario: Binding Promote Bielefeld to German '1. Liga' and relegate Frankfurt 1L=resolve("UEFA","Germany","1. Liga") root: Naming Contextc:Client1L:NamingContext bind("Arm. Bielefeld", bielefeld) unbind("Eintr. Frankfurt")

Naming Service 23 Resolve Names Module cosNaming{ //interface NamingContext{ Object resolve(in Name n) raise(NotFound, InvalidName, CannotProceed); //}; };  It resolves the first component of the name to an object reference.  If there are no remaining components, it returns this object reference to the caller.  Otherwise, it narrows the object reference to a NamingContext and passes the reminder of the name to its resolve operation

Naming Service 24 NotFound Exception Module cosNaming{ … interface NamingContext{ … enum NotFoundReason {missing_node, not_context, not_object}; exception NotFound { NotFoundReason why; Name rest_of_name; };

Naming Service 25 Browsing Contexts Module cosNaming{ //interface NamingContext{ interface BindingIterator { boolean next_one(out Binding b); boolean next_n(in unsigned long how_many, out BindingList bl); void destroy(); }; void list (in unsigned long how_many, out BindlingList bl, out BindingIterator bi); //}; };

Naming Service 26 Converting Names: NamingContextExt Module cosNaming{ interface NamingContextExt:NamingContext{ typedef string StringName; typedef string Address; typedef string URLString; StringName to_string(in Name n) raises (InvalidName); Name to_name(in StringName sn) raises (InvalidNames); URLString to_url(in Address addrKey, in StringName sn) raises(InvalidAddress, InvalidName); Object resolve_str(in StringName sn) raises(NotFound, CannotProceed, InvalidName); };

Naming Service 27 Federated Naming Service  Naming service supports federation: distinct naming servers can be linked together to create a single naming graph.  A client can then navigate seamlessly throughout the naming graph without being aware that it is federated.  The support is through bind_context()  Graph or hierarchy?  Cycles in the graph

Naming Service 28 Federated Naming Service A B C Naming Service X Naming Service Y

Naming Service 29 Federated Naming Service A B U V Context A can be accessed by: A, A/B/V/U/A, or A/B/V/U/A/B/U/V/A Avoid infinite loop

Naming Service 30 Building Applications Using CORBA  Room booking system:  Booking rooms for meetings for a duration (from 9:00 am to 4:00 pm by hour);  Canceling the bookings  The number and names of rooms can change  When booking a room, a purpose and the name of the person making the booking should be given  System design decisions:  Rooms and meetings are CORBA objects  A meeting object defines a purpose and the person responsible for the meeting  A meeting factory creates meeting objects  A room stores meetings indexed by time slots  Room have a name and register themselves under this name with the Naming Service

Naming Service 31 Room Booking System MeetingFactoryImpl MeetingImpl MeetingFactoryServer NamingContext CORBA Naming Service RoomImpl RoomServer RoomImpl RoomServer RoomImpl RoomServer Proxy Client Application CreateMeeting() bind() resolve() view() book() cancelBooking() bind()

Naming Service 32 Room Booking Naming Convention Root Naming Context BuildingApplications Rooms Context Object Board Room Meeting Room Chairmen’s Office Object Name Meeting Factory

Naming Service 33 Source Code  Chapter 8  Client  ClientApplication.java (“main”)  RoomBookingClient.java (“Impl”)  Server  Room –RoomServer.java –RoomImpl.java  MeetingFactory –MeetingFactoryServer.java –MeetingFactoryImpl.java  Meeting –MeetingImpl.java

Naming Service 34 Source Code  Client  ClientApplication.java (“main”)  Create “impl” client = RoomBookingClient();  Initialize NS: client.init_from_ns();  View existing bookings: client.view()  RoomBookingClient (“impl”)  Private: –orb, root_context, room_context, meeting_factory, rooms, meetings, booked, ior  Constructor: –Initialize orb –Get root_context  Init_from_ns: –From root_context get room_context –From root_context get meeting_factory  View: –Get rooms, –List meetings

Naming Service 35 Source Code  Server  Room  RoomServer.java –Initialize ORB orb = ORB.init( args, null ); POA poa = POAHelper.narrow( orb.resolve_initial_references( "RootPOA")); poa.the_POAManager().activate(); –Create room object and export the object reference org.omg.CORBA.Object room_obj = poa.servant_to_reference ( new RoomImpl( args[0] ) ); –Register with naming service NamingContextExt root = NamingContextExtHelper.narrow ( orb.resolve_initial_references("NameService")); root.bind_new_context( root.to_name( context_name )); str_name = context_name + "/" + args[0]; root.bind( root.to_name( str_name), room_obj ); –Wait for request orb.run();

Naming Service 36 Source Code  Server  Room  RoomImpl.java –Inherit from RoomPOA public class RoomImpl extends RoomPOA –Implement all the operations declared in the idl: »Attributes »View »Book »Cancelbooking

Naming Service 37 Source Code  Server  MeetingFactory  MeetingFactoryServer.java –Initialize ORB orb = ORB.init( args, null ); POA poa = POAHelper.narrow( orb.resolve_initial_references( "RootPOA")); poa.the_POAManager().activate(); –Create room object and export the object reference org.omg.CORBA.Object meeting_factory_obj = poa.servant_to_reference ( new MeetingFactoryImpl( ) ); –Register with naming service NamingContextExt root = NamingContextExtHelper.narrow ( orb.resolve_initial_references("NameService")); root.bind_new_context( root.to_name( context_name )); str_name = context_name + "/" + args[0]; root.bind( root.to_name( str_name), meeting_factory_obj ); –Wait for request orb.run();

Naming Service 38 Source Code  Server  MeetingFactory  MeetingFactoryImpl.java –Inherit from MeetingFactoryPOA public class MeetingFactoryImpl extends MeetingFactoryPOA –Implement all the operations declared in the idl: »createMeeting MeetingImpl meetingImpl = new MeetingImpl(purpose, participants); try { org.omg.CORBA.Object obj = _poa().servant_to_reference(meetingImpl); Meeting meeting = MeetingHelper.narrow(obj); return meeting; } …

Naming Service 39 Source Code  Server  Meeting  MeetingImpl.java –Inherit from MeetingPOA public class MeetingImpl extends MeetingPOA –Implement all the operations declared in the idl: »Attributes »Destory  Not all Corba objects need to be registered with NS  servant_to_reference(meetingImpl) is done by other entity (MeetingFactoryImpl)

Naming Service 40 Limitations of Naming Service  Limitation of Naming in all approaches: Client always has to identify the server by name.  Inappropriate if client just wants to use a service at a certain quality but does not know from who:  Automatic cinema ticketing,  Video on demand,  Electronic commerce.