1 / 37

CORBA

CORBA. Objectifs des approches distribuées Vue macroscopique. Développer des applications dont les services sont répartis sur plusieurs machines interconnectées par un réseau Contraintes Développement similaire à une approche centralisée Moyens : masquer les "détails"

berny
Download Presentation

CORBA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CORBA Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  2. Objectifs des approches distribuéesVue macroscopique • Développer des applications dont les services sont répartis sur plusieurs machines interconnectées par un réseau • Contraintes • Développement similaire à une approche centralisée • Moyens : masquer les "détails" • "Détails" du réseau => On ne connaît pas la localisation • "Détails" des langages utilisés => On ne connaît pas l'implantation Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  3. Quelques architectures • OSF (Open Software Foundation) • Distributed Computing Environnement • Microsoft • Distributed Component Object Model • OMG (Object Management Group) • Common Object Request Broker Architecture (CORBA) • Sun • EJB (Enterprise Java Beans) Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  4. CORBA • Fondé sur le modèle client/serveur s'échangeant des valeurs • Une architecture • OMA : Object Management Architecture • Un langage de description des services offerts • IDL : Interface Definition Language • Un modèle d'échange d'informations • Valeurs atomiques, Valeurs Contruites et Références d'objet • Mais surtout une spécification papier de l'ORB et des services Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  5. Problématique Vue microscopique • Service ==> appel des méthodes • Etat ==> accès aux attributs Service ? Etat ? Objet client Objet serveur Espace 2 Espace 1 Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  6. Principe des échanges Appel spécifique Appel spécifique Echange neutre Espace 2 • Fournir des objets de service qui vont servir d'intermédiaires pour le client et le serveur Espace 1 Objet client Objet serveur Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  7. Fonctionnement Mandataire client (stub) Mandataire serveur (skeleton) Serveur Client Système Intermédiaire Client Système Intermédiaire Serveur Espace 2 Espace 1 Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  8. Fonctionnement lancement Serveur Instanciation du serveur Lanceur Mandataire client Mandataire serveur Lancement du mandataire Demande de service le mandataire est prêt Appel du lanceur le service est prêt Recherche du service Référentiel des Services Le client peut invoquer les méthodes du service Client ORB Client ORB Serveur Espace 2 Espace 1 Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  9. Développement 1) Définition de l'interface IDL du composant (objet serveur) • mandataires client (client stubs) • mandataires serveurs (serveur skeleton) 2) Développement du serveur qui implante les services 3) Développement d'un lanceur capable d'instancier le serveur et de le rendre disponible sur le bus corba (création du skeleton) 4) Inscription du lanceur sur le bus(ajout dans le référentiel) ------------------------- 5) Insertion dans le client des appels au serveur (connexion sur le serveur via le stub et invocation des méthodes distantes) Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  10. Un exemple • Un composant Requête sur une base de données • Le composant maintient une connexion sur une base • Il contient une méthode d'invocation • Chaine [] executerRequete (Chaine commandeSQL); Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  11. OMG-IDL : Définition • Langage de spécification des interfaces • Orienté Objet • Opérations et Attributs • Héritage simple et multiple • Exceptions • Conçu pour être mappé sur de nombreux langages de programmation • Java, C, C++ , Smalltalk, Ada, Cobol, Modula3 • OMG-IDL <=> «Interfaces» Java, «Classes Abstraites» du C++ Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  12. 1 IDL typedef sequence<string> tableaux_resultat; interface REQUETE { tableaux_resultat executer_req_array(in string req); }; --> Compilation : idl -jPacces_bd requete.idl (sous OrbixWeb) Mandataire client : REQUETE.java Service client pour demander un proxy : REQUETEHelper.java Mandataire serveur : _tie_REQUETE.java Interface de développement du serveur : _REQUETEOperations Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  13. Développement du serveur • Garantit que toutes les fonctions sont implantées • N'importe quel langage sur lequel est défini un mapping ------------- Implante REQUETE_Operations package acces_bd; public interface _REQUETEOperations { public String[] executer_req_array(String req); } Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  14. 2 Développement du serveur package acces_bd; import java.sql.*; import java.util.Vector; class REQUETEImplementation implements _REQUETEOperations { Connection con=null; public REQUETEImplementation() { try { DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver ()); } catch (Exception raison1) { System.out.println("pb pendant new oracle.jdbc.driver....."); } try { con = DriverManager.getConnection ("jdbc:oracle:thin:@lisiaix0.insa-lyon.fr:1526:INSA", "bcb", "bcb"); } catch (Exception raison2) { System.out.println("pb pendant get connection jdbc....."); } } Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  15. 2 Développement du serveur public String[] executer_req_array(String req){ String resultat[]; Vector resultvector=new Vector(); Statement stmt=null; ResultSet rs=null; int ncols=0; try { // Lancement de la requête stmt = con.createStatement(); rs = stmt.executeQuery(req); ncols= rs.getMetaData().getColumnCount(); }catch (Exception ex) {//code d'erreur} try { while (rs.next) { for (int i=1; i<=ncols; i++) resultvector.addElement(rs.getString(i));} }catch (Exception ex) { } resultat =new String[resultvector.size()]; resultvector.copyInto(resultat); return resultat;} Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  16. Développement du lanceur (adapteur d'objet) • Enregistre les classes d’implantation des serveurs • Active / désactive les serveurs • Génération / interprétation des références sur les objets • Plusieurs types en fonction de la nature du serveur Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  17. 3 Développement du lanceur package acces_bd; public class composantserv { public static void main (String args []) { REQUETE REQUETEImpl=null; //Nom du mandataire REQUETEImplementation tmp=null; //Nom du serveur try { tmp=new REQUETEImplementation(); REQUETEImpl = new _tie_REQUETE(tmp); }catch(SystemException se1) { } try { IE.Iona.OrbixWeb._CORBA.Orbix.impl_is_ready("SERVICEREQUETES");} catch(SystemException se) {} } } Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  18. 4 Inscription du lanceur putit -j LAREQUETE acces_bd.composantserv • Implantation sur le système de fichiers du serveur • Annuaire des objets du système distribué (Interface Repository) • Banque d’objets métiers de l’entreprise • Accessible à l’ORB et aux développeurs • Possibilité de fédération d’IR Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  19. Liste des services Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  20. Le fichier de définition Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  21. Développement du client • Se connecte sur le service d'intermédiation • Demande l'accès à un service particulier • Reçoit une référence sur le mandataire du serveur • Peut invoquer des méthodes sur les mandataires serveurs pour récupérer des valeurs. • Aussi simple que si l'objet serveur est local Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  22. 5 Développement du client package acces_bd; public class composantcli { public static void main(String args[]) { REQUETE myreq = null; String [] reponse=new String [0]; ORB.init(); //Initialisation de l'accès à l'ORB try { myreq = REQUETEHelper.bind(":LAREQUETE","lisisun1.insa-lyon.fr); } catch (Exception raison) { // } String req= "select * from tab"; try { reponse=myreq.executer_req(req); }catch (Exception raison){ } for (int i=0; i<reponse.length; i++) { System.out.println(reponse[i]);}}} Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  23. Classes impliquées sur le client héritage interface classe Classe statique Package Classe Abstraite Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  24. Classes impliquées sur le serveur Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  25. Schéma général de développement Description d’interface en IDL Référentiel des Interfaces (2) Implantation des interfaces IDL (1) Compilation IDL (5) Implantation des clients Code des classes Squelettes IDL Souches IDL Code des clients + (3) Implantation des serveurs + Applications clientes (4) Installation Configuration des serveurs Référentiel des Implantation Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  26. Les Services CORBA OMA : Object Management Architecture Les Canevas CORBA La Plomberie CORBA Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  27. OMG Services  Utilitaires Communs Services orientés utilisateurs Santé Finance Télécom verticaux Objets Développés Spécifiques et non standardisés Gestion information Administration Système Gestion des tâches IU horizontaux Common Object Request Broker Architecture (CORBA) Nommage Persistance Transactions Collections Négociateurs Temps Licences Concurrence d’accès Propriétés Externalisation Versions Evénement Cycle de vie Relations Sécurité d’accès Service Objet Communs Services orientés systèmes Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  28. Un autre exemple : Médicaments typedef sequence<string> liste_chaine; interface Medicaments { attribute string code_cip; attribute string nom_medicament; liste_chaine donner_indications(in string code_cip); liste_chaine donner_contre_indications(in string code_cip); liste_chaine donner_effets_indesirable(in string code_cip); struct_interac donner_interactions(in string code_cip1,in string code_cip2);}; struct resultat_interactions { string principe_actif1; string principe_actif2; string nom_pa1; string nom_pa2; string libelle_gravite; string libelle_message; string type_interaction; }; typedef sequence<resultat_interactions> struct_interac; Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  29. Canevas de composants Description des médicaments Service de requêtage Client ORB ORB ORB Espace 1 Espace 2 Espace 3 Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  30. Architecture fonctionnelle de l’ORB Implantation Objet : serveur Client Référentiel des Interfaces Référentiel des Implantations Squelettes IDL (statique) Squelettes Dynamique Adaptateur d’objets Interface de l’ORB Invocation Dynamique Souches IDL Noyau de l’ORB Spécifique à l’ORB Interface standard des ORB Une interface par classe d’objet Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  31. Composants de Corba (Spec. V2.0) • ORB : Négociateur de requêtes objet • BOA : Adaptateur d’objets • IDL : Langage de définition des interfaces • SII : Interface d’invocation statique • IR : Entrepôt des interfaces et implantations • Mise en correspondance vers langages hôtes java, c, c++ ... • IIOP : Communication inter-ORB • DII : Interface d’invocation dynamique • DSI : Squelette d’interface dynamique Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  32. CORBA, c’est : • Une architecture complète d’objets distribués • Des spécifications techniques qui font partie d’un tout : l’OMA • Séparation entre la couche service (IDL) et la plomberie (ORB) Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  33. Limitation des fonctionnalité • Pas de réponse par rapport aux problèmes classiques des applications distribuées : • Délais d’attente • Tolérance aux pannes • Ordonnancement des événements • Verrou Mortel • De plus • Pas de transmission d'objets • Pas de traitements groupés • Problème des objets à granularité fine Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  34. Limitation des performances • Plus lent qu’une application spécifique • Surcoût lié à la résolution de noms • Traitement des paramètres • Recopie de données • Gestion de la mémoire • Démultiplexage • Probleme classique : • Trouver l’équilibre entre extensibilité, solidité, maintenabilité et efficacité des couches de bas niveau • Un bon ORB devrait être capable d’optimiser les fonctionnalités supérieures Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  35. Marché des objets distribués • Architectes de canevas de composants • Développeurs de composants • Intégrateurs de composants ------------------------------------------------- Biblio ? ORB public : HORB, MICO, Jonathan Manuels de Iona, Visigenic... http://www.iona.com, http://www.visigenic.com http://www.omg.org Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  36. Modes d'invocation transparent • objetDistant.methode( ); • objetDisant=ServicedeRecherche.recherche("UnObjet"); • resultat=objetLocal.methode(objetDistant); • resultat=objetDistant.methode(objetDistant2); • ObjetDistant=new ObjetDistant( ); Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

  37. Compléments • Krakowiak http://sirac.imag.fr/ • J.M. Geib, C. Gransart, Ph.Merle CORBA, des concepts à la pratique • Douglas Schmidt http://www.cs.wustl.edu/~shmidt Stéphane Frenot - Département Télécommunication - SID - stephane.frenot@insa-lyon.fr

More Related