Remote Method Invocation



Similar documents
Langages Orientés Objet Java

Remote Method Invocation

Brazil + JDBC Juin 2001, douin@cnam.fr

Licence Informatique Année Exceptions

Remote Method Invocation in JAVA

Personnalisez votre intérieur avec les revêtements imprimés ALYOS design

Thursday, February 7, DOM via PHP

ExempleRMI.java. // Fichier de defintion des droits et proprietes // System.setProperty("java.security.policy","../server.java.

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

Network Communication

Introduction au BIM. ESEB Seyssinet-Pariset Economie de la construction contact@eseb.fr

Cours. Client/serveur avancé en Java (servlets, RMI, etc.) M.M.F.A.I. François Bourdoncle

POB-JAVA Documentation

Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS)

Archived Content. Contenu archivé

Cours de Java. Sciences-U Lyon. Java - Introduction Java - Fondamentaux Java Avancé.

The Java Series Introduction to Java RMI and CORBA. The Java Series. Java RMI and CORBA Raul RAMOS / CERN-IT User Support Slide 1

Report of the case study in Sistemi Distribuiti A simple Java RMI application

Introduction. GEAL Bibliothèque Java pour écrire des algorithmes évolutionnaires. Objectifs. Simplicité Evolution et coévolution Parallélisme

When the transport layer tries to establish a connection with the server, it is blocked by the firewall. When this happens, the RMI transport layer

How To Write A Program In Java (Programming) On A Microsoft Macbook Or Ipad (For Pc) Or Ipa (For Mac) (For Microsoft) (Programmer) (Or Mac) Or Macbook (For

TIMISKAMING FIRST NATION

RAPPORT FINANCIER ANNUEL PORTANT SUR LES COMPTES 2014

Sun Management Center Change Manager Release Notes

Interfaces de programmation pour les composants de la solution LiveCycle ES (juillet 2008)

TP : Configuration de routeurs CISCO

Introduction ToIP/Asterisk Quelques applications Trixbox/FOP Autres distributions Conclusion. Asterisk et la ToIP. Projet tuteuré

HEALTH CARE DIRECTIVES ACT

CSS : petits compléments

Programmation RMI Sécurisée

sept-2002 Computer architecture and software cells for broadband networks Va avec

TP : Système de messagerie - Fichiers properties - PrepareStatement

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index:

Archived Content. Contenu archivé

! "# $%&'( ) * ).) "%&' 1* ( %&' ! "%&'2 (! ""$ 1! ""3($

N1 Grid Service Provisioning System 5.0 User s Guide for the Linux Plug-In

Solaris 10 Documentation README

«Object-Oriented Multi-Methods in Cecil» Craig Chambers (Cours IFT6310, H08)

Liste d'adresses URL

Archived Content. Contenu archivé

Archived Content. Contenu archivé

Short Form Description / Sommaire: Carrying on a prescribed activity without or contrary to a licence

Veritas Storage Foundation 5.0 Software for SPARC

Audit de sécurité avec Backtrack 5

Invocación remota (based on M. L. Liu Distributed Computing -- Concepts and Application

Archived Content. Contenu archivé

Archived Content. Contenu archivé

Sun StorEdge A5000 Installation Guide

Sélection adaptative de codes polyédriques pour GPU/CPU

Middleware Lou Somers

niveau : 1 ere année spécialité : mécatronique & froid et climatisation AU : Programmation C Travaux pratiques

Calcul parallèle avec R

SunFDDI 6.0 on the Sun Enterprise Server

TP JSP : déployer chaque TP sous forme d'archive war

The Register of the Domain of the State A Revolution in the Registration of Land Rights

Méthodes ensemblistes pour une localisation robuste de robots sous-marins

Remote Method Invocation (RMI)

System Requirements Orion

Programmation Orientée Objets. et langage Java

Comparing JavaServer Pages Technology and Microsoft Active Server Pages

Measuring Policing Complexity: A Research Based Agenda

Retour vers le futur des bibliothèques de squelettes algorithmiques et DSL

Managing the Knowledge Exchange between the Partners of the Supply Chain

Client-Server Programming in Java-RMI

Sun Enterprise Optional Power Sequencer Installation Guide

TP N 10 : Gestion des fichiers Langage JAVA

Annexe - OAuth Introduction. Xavier de Rochefort xderoche@labri.fr - labri.fr/~xderoche 15 mai 2014

Product / Produit Description Duration /Days Total / Total

Future Entreprise. Jean-Dominique Meunier NEM Executive Director Nov. 23, 2009 FIA Stockholm

Load balancing using Remote Method Invocation (JAVA RMI)

JANVIER 2013 / CATALOGUE DES FORMATIONS

Machine de Soufflage defibre

Introduction to Java Distributed Objects - Using RMI and CORBA

Democratic Republic of the Congo Tourist visa Application

Sun Management Center 3.6 Version 5 Add-On Software Release Notes

Unrealized Gains in Stocks from the Viewpoint of Investment Risk Management

June 2016 Language and cultural workshops In-between session workshops à la carte June weeks All levels

Sun StorEdge RAID Manager Release Notes

In-Home Caregivers Teleconference with Canadian Bar Association September 17, 2015

Qu est-ce que le Cloud? Quels sont ses points forts? Pourquoi l'adopter? Hugues De Pra Data Center Lead Cisco Belgium & Luxemburg

Optimizing Solaris Resources Through Load Balancing

BILL C-665 PROJET DE LOI C-665 C-665 C-665 HOUSE OF COMMONS OF CANADA CHAMBRE DES COMMUNES DU CANADA

Technical Service Bulletin

Archived Content. Contenu archivé

SUBJECT CANADA CUSTOMS INVOICE REQUIREMENTS. This Memorandum explains the customs invoice requirements for commercial goods imported into Canada.

Certificat de fusion. Certificate of Amalgamation. Canada Business Corporations Act. Loi canadienne sur les sociétés par actions

Applying this template to your existing presentation

Archived Content. Contenu archivé

Tanenbaum, Computer Networks (extraits) Adaptation par J.Bétréma. DNS The Domain Name System

Certificate of Incorporation Certificat de constitution

site et appel d'offres

Proposition d intervention


Reconstruction d un modèle géométrique à partir d un maillage 3D issu d un scanner surfacique

Transcription:

1 / 22 Remote Method Invocation Jean-Michel Richer jean-michel.richer@univ-angers.fr http://www.info.univ-angers.fr/pub/richer M2 Informatique 2010-2011

2 / 22 Plan Plan 1 Introduction 2 RMI en détails 3 Exemple 4 Application

3 / 22 Introduction Introduction Introduction

4 / 22 Introduction Principe Le principe applications distribuées (ex. Agence de Voyage) appel de services distants (interaction avec des objets/services situés sur une autre machine) obtention de données distantes (communication données résultat)

5 / 22 Introduction Technologies Les technologies Il existe plusieurs protocoles/frameworks/technologies : RPC (Remote Procedure Call) RMI (Remote Method Invocation) SUN CORBA (Common Object Request Broker Architecture)- OMG (Object Management Group) DCOM - Microsoft

6 / 22 Introduction RMI - SUN Propriétés de RMI échange d information entre deux JVM (Java Virtual Machine) orienté objet sérialisation des objets Java chargement dynamique des objets/services

7 / 22 RMI en détails RMI en détails RMI en détails

8 / 22 RMI en détails RMI RMI-JRMP (Java Remote Method Protocol) version d origine intégrée au langage simple d utilisation RMI-IIOP (Internet InterORB(Object Request Broker) Protocol) version récente comptatible CORBA plus difficile à mettre en oeuvre

RMI en détails Différences JRMP-IIOP Différences implantation d un objet distant : JRMP : UnicastRemoteObject IIOP : PortableRemoteObject ramasse miettes (garbace collector) : JRMP : implicite (DGC) IIOP : à réaliser (unreferenced()) 9 / 22

10 / 22 RMI en détails RMI Service distant Les fonctionnalités d un service distant sont définies par une interface sur le serveur : l interface est implantée sur le client : l interface sert de proxy (serveur mandataire)

11 / 22 RMI en détails le Skeleton où partie Serveur Le Skeleton (Squelette) objet distant qui implémente les méthodes visibles réception des données (unmarshall) exécution de la méthode envoi du résultat (marshall) Note Avec Java 2, le squelette est devenu obsolète.

12 / 22 RMI en détails le Stub où partie Client Le Stub (Souche) représentant local de l objet distant qui implémente les méthodes visibles envoi des paramètres (marshall) récupération des données (unmarshall)

13 / 22 Exemple Exemple Exemple

14 / 22 Exemple Exemple Exemple Appel d un objet distant qui réalise l addition de deux nombres réels.

15 / 22 Exemple Interface Interface définition de l interface de communication : méthode add étend Remote chaque méthode est susceptible de générer une exception partie interface 1 import java.rmi.*; 2 3 public interface Service extends Remote { 4 public float add(float a, float b) throws RemoteException; 5 } 6 7

16 / 22 Exemple Implantation Implantation étend UnicastRemoteObject implante l interface Service implantation de la méthode add partie implantation 1 import java.rmi.*; 2 import java.rmi.server.*; 3 4 public class ServiceImpl extends UnicastRemoteObject implements Service { 5 6 public ServiceImpl() throws RemoteException { 7 super(); 8 } 9 10 public float add(float a, float b) throws RemoteException { 11 return a+b; 12 } 13 } 14

17 / 22 Exemple Serveur Implantation enregistrement du service Naming.rebind() partie serveur 1 import java.rmi.*; 2 3 public class ServiceServer { 4 5 public ServiceServer() { 6 try { 7 ServiceImpl s=new ServiceImpl(); 8 Naming.rebind( rmi://localhost:1099/service, s); 9 } catch(exception e) { 10 System.out.println(e.getMessage()); 11 } 12 } 13 14 public static void main(string args[]) { 15 new ServiceServer(); 16 } 17 } 18

18 / 22 Exemple Client Implantation appel du service Naming.lookup() partie client 1 import java.rmi.*; 2 3 public class ServiceClient { 4 5 public static void main(string args[]) { 6 try { 7 Service s=(service) Naming.lookup( rmi://localhost:1099/service ); 8 System.out.println( s.add(4.2f, 3.7f) ); 9 } catch(exception e) { 10 System.out.println(e.getMessage()); 11 e.printstacktrace(); 12 } 13 } 14 } 15

Exemple Compilation et exécution Compilation javac *.java rmic ServiceImpl Exécution shell1> rmiregistry shell2> java ServiceServer shell3> java ServiceClient 19 / 22

20 / 22 Application Application Application

Application Application Partie Serveur Créer un objet distant qui sera chargé de fournir la liste des personnes stockées dans une base de données et dont le nom ou prénom correspond à des valeurs fournies en paramètres. Partie Client Interrogation du service distant et affichage des personnes susceptibles de répondre aux critères fournis. 21 / 22

22 / 22 Application Bibliographie Développement Web avec J2EE, O Reilly, Eric Sarrion, Paris, 2005, ISBN 2-35402-140-2 Au coeur de Java 2 - Fonctions avancées, Campus Press, Hortsmann et Cornell, 2002, ISBN 2-7440-1332-3