Size: px
Start display at page:

Download ""

Transcription

1 1 of 10 11/13/2007 7:35 AM CS 696 Emerging Technologies: Java Distributed Computing Spring Semester, 1999 Simple Jini Example Previous Lecture Notes Index Next 1999, All Rights Reserved, SDSU & Roger Whitney San Diego State University -- This page last updated 18-Mar-99 References Hello World Example Example Explained The Client Service Lookup Matching Entries Standard Entry Subclasses Entry & JavaBeans HelloServer Contents of Doc 18, Simple Jini Example References Jini API, Local on-line version at: Jini Entry Specification 1.0 January 25, 1999 Jini Entry Utilities Specification 1.0 January 25, 1999 Jini Lookup Service Specification 1.0 January 25, 1999 Jini Lookup Attribute Schema Specification 1.0 January 25, 1999 These documents are available at: Noel Enete s Nuggets for Jini, Hello World Example Doc 18, Simple Jini Example Slide # 2 This example: Uses a null lease Uses unicast discovery & join Is derived from an example in Noel Enete s Nuggets for Jini package whitney.jini.examples.hello; import java.rmi.remote; import java.rmi.remoteexception; public interface HelloInterface extends Remote

2 2 of 10 11/13/2007 7:35 AM public String sayhello() throws RemoteException; Doc 18, Simple Jini Example Slide # 3 HelloServer package whitney.jini.examples.hello; import net.jini.core.entry.entry; import net.jini.core.lookup.serviceid; import net.jini.lookup.entry.name; import com.sun.jini.lookup.serviceidlistener; import com.sun.jini.lookup.joinmanager; import com.sun.jini.lease.leaserenewalmanager; import java.rmi.remote; import java.rmi.remoteexception; import java.rmi.rmisecuritymanager; import java.rmi.server.unicastremoteobject; public class HelloServer extends UnicastRemoteObject implements HelloInterface, ServiceIDListener private ServiceID myid; public HelloServer() throws RemoteException public String sayhello () throws RemoteException return ("Hello World from Jini Hello server!"); public void serviceidnotify (ServiceID uniqueid) myid = uniqueid; System.out.println("server: ID set: " + myid ); Doc 18, Simple Jini Example Slide # 4 HelloServer Main public static void main (String[] args) throws Exception System.setSecurityManager (new RMISecurityManager ()); HelloServer myserver = new HelloServer (); Entry[] identityingattributes = new Entry[1]; identityingattributes[0] = new Name("HelloServer"); JoinManager mymanager = new JoinManager ( myserver, identityingattributes, myserver, new LeaseRenewalManager () ); System.out.println ("Server has been Joined!"); Doc 18, Simple Jini Example Slide # 5 HelloClient package whitney.jini.examples.hello; import net.jini.core.entry.entry; import net.jini.core.lookup.servicetemplate; import net.jini.core.lookup.serviceregistrar;

3 3 of 10 11/13/2007 7:35 AM import net.jini.core.discovery.lookuplocator; import net.jini.lookup.entry.name; import java.rmi.rmisecuritymanager; public class HelloClient public static void main (String[] args) throws Exception System.setSecurityManager (new RMISecurityManager ()); LookupLocator lookup = new LookupLocator ("jini://eli.sdsu.edu"); ServiceRegistrar registrar = lookup.getregistrar (); Entry[] serverattributes = new Entry[1]; serverattributes[0] = new Name ("HelloServer"); ServiceTemplate template = new ServiceTemplate (null, null, serverattributes); HelloInterface myserverinterface = (HelloInterface) registrar.lookup (template); System.out.println ( myserverinterface.sayhello () ); Doc 18, Simple Jini Example Slide # 6 Example Explained The Client public static void main (String[] args) throws Exception System.setSecurityManager (new RMISecurityManager ()); LookupLocator lookup = new LookupLocator ("jini://eli.sdsu.edu"); ServiceRegistrar registrar = lookup.getregistrar(); Service Lookup net.jini.core.discovery.lookuplocator A utility class that performs unicast discovery for a Lookup service LookupLocator(String url) LookupLocator(String host, int port) Constructors The URL type is jini Default port for a lookup service is 4160 Translate CAFE-BABE from hex to decimal to get 4160 String gethost() int getport() ServiceRegistrar getregistrar() ServiceRegistrar getregistrar(int timeout) Perform unicast discovery and return the ServiceRegistrar object for the given lookup service.

4 4 of 10 11/13/2007 7:35 AM Doc 18, Simple Jini Example Slide # 7 Interface net.jini.core.lookup.serviceregistrar Methods Information about available services Class[] getentryclasses(servicetemplate tmpl) Object[] getfieldvalues(servicetemplate, int setindex, String field) Class[] getservicetypes(servicetemplate, String prefix) Object lookup(servicetemplate tmpl) ServiceMatches lookup(servicetemplate tmpl, int maxmatches) Returns the service object from an item matching the template String[] getgroups() Information about Lookup service Returns the groups that this lookup service is a member of. LookupLocator getlocator() LookupLocator for unicast discovery of lookup service. ServiceID getserviceid() Notifcation, Registration EventRegistration notify(servicetemplate tmpl, int transitions, RemoteEventListener listener, MarshalledObject handback, long leaseduration) ServiceRegistration register(serviceitem item, long leaseduration) Doc 18, Simple Jini Example Slide # 8 HelloClient Continued // Create ServiceTemplate used to match or find the server // we want Entry[] serverattributes = new Entry[1]; serverattributes[0] = new Name ("HelloServer"); ServiceTemplate template = new ServiceTemplate (null, null, serverattributes); HelloInterface myserverinterface = (HelloInterface) registrar.lookup (template); Interface net.jini.core.entry.entry Entry subclasses: Are used in identifying and matching services

5 5 of 10 11/13/2007 7:35 AM Contains public fields of non-primitive types Must have no-argument constructor All fields must be serializable Each field is serialized separately, so references between two fields of an entry will not be reconstituted to be shared references, but instead to separate copies of the original object If a field of an entry being fetched is cannot be deserialized for any reason then net.jini.core.entry.unusableentryexception will be thrown when Entry is a marker interface, it has no methods Matching Entries Doc 18, Simple Jini Example Slide # 9 Let T (for template) be an object of a subclass Entry Let E be an object of a subclass of Entry A field of an Entry object is a wildcard it its value is null The template T matches E if: The type of E must be that of T, or be a subtype of the type of T Fields with values in T must be matched exactly by the value in the same field of E. Wildcards in T match any value in the same field of E. MarshalledObject.equals is used to test equality of fields, not Object.equals This means the bytes generated by their serialized form must match, ignoring differences of serialization stream implementation (such as blocking factors for buffering). Class version differences that change the bytes generated by serialization will cause objects not to match. net.jini.core.lookup.servicetemplate Constructor ServiceTemplate(ServiceID serviceid, Class[] servicetypes, Entry[] attrsettemplates) Doc 18, Simple Jini Example Slide # 10 Entry[] attributesettemplates ServiceID serviceid Public Fields

6 6 of 10 11/13/2007 7:35 AM Class[] servicetypes ServiceTemplates are used to match for services A service template (tmpl) matches service item (item) a if: item.serviceid equals tmpl.serviceid If tmpl.serviceid is null then tmpl and item match if: item.service is an instance of every type in tmpl.servicetypes and item.attributesets contains at least one matching entry for each entry template in tmpl.attributesettemplates. Standard Entry Subclasses net.jini.lookup.entry Classes Some basic entry classes with their fields. All fields are Strings Address ServiceInfo Location Name country manufacturer building name locality model floor organization serialnumber room organizationalunit vendor Doc 18, Simple Jini Example Slide # 11 Comment postalcode version comment stateorprovince street Status & StatusType Status is base class from which other status-related entry classes may be derived. StatusType defines status types: ERROR NORMAL NOTICE WARNING

7 net.jini.entry.abstractentry Useful base class for entry types You don t have to use this class, but will save you some effort Doc 18, Simple Jini Example Slide # 12 Entry & JavaBeans Jini uses JavaBeans to display entry objects to humans You should have a JavaBean class for an Entry class that a human may interact with Let X be an entry class then: JavaBean Class Design Pattern The JavaBean class for X is called XBean For each field F in X class XBean has methods: setf() and getf() XBean has an no-argument constructor XBean implements net.jini.lookup.entry.beanentry XBean has methods followlink(), makelink() These methods set and get the bean s field that contains the bean s entry object Location Entry Example Location fields and LocationBean s methods Location building floor room LocationBean Entry followlink() getbuilding() getfloor() getroom() makelink(entry e) setbuilding(string x) setfloor(string x) setroom(string x) 7 of 10 11/13/2007 7:35 AM

8 8 of 10 11/13/2007 7:35 AM Doc 18, Simple Jini Example Slide # 13 HelloClient Matching The following code creates a simple template to use to find a service. The service id is set to null, so it is not used. Using the service ID would be faster, but we need to know it. We also set the servicetypes to null. This means the template will match any servicetypes. If we were looking for printers, we might set servicetypes to be an array containing a printer type. Jini does not define these servicetypes. They must be supplied by Jini developers. Only one entry template is given. Hence this service template will match any service that contains an entry of type "Name" or subtype of "Name" with the field "name" equal to the value "HelloServer". Entry[] serverattributes = new Entry[1]; serverattributes[0] = new Name ("HelloServer"); ServiceTemplate template = new ServiceTemplate (null, null, serverattributes); HelloInterface myserverinterface = (HelloInterface) registrar.lookup (template); Doc 18, Simple Jini Example Slide # 14 HelloServer public class HelloServer extends UnicastRemoteObject implements HelloInterface, ServiceIDListener private ServiceID myid; public void serviceidnotify (ServiceID uniqueid) myid = uniqueid; System.out.println("server: ID set: " + myid ); Each service has a unique service id net.jini.core.lookup.serviceid The id is unique over time and space with respect to all other service ids generated by all lookup services. The id is a 128-bit value, to insure this uniqueness. It is to be set by the lookup service. To re-register an existing service, or to register the service in any other lookup service, item.serviceid should be set to the same service id that was returned by the initial registration. Contains one method, serviceidnotify com.sun.jini.lookup.serviceidlistener The lookup service calls this method to provide the service its service ID.

9 9 of 10 11/13/2007 7:35 AM Doc 18, Simple Jini Example Slide # 15 HelloServer Main HelloServer myserver = new HelloServer (); Entry[] identityingattributes = new Entry[1]; identityingattributes[0] = new Name("HelloServer"); JoinManager mymanager = new JoinManager ( myserver, identityingattributes, myserver, new LeaseRenewalManager () ); com.sun.jini.lookup.joinmanager This class manages the join protocol for a service. It discovers and keeps track of which lookup services to join, registers with them, keeps the registration leases renewed, and keeps the attributes up to date. JoinManager(Object service, Entry[] attrsets, ServiceIDListener callback, LeaseRenewalManager leasemgr) addattributes(entry[] attrsets) addattributes(entry[] attrsets, boolean checksc) addgroups(string[] groups) addlocators(lookuplocator[] locators) Entry[] getattributes() String[] getgroups() ServiceRegistrar[] getjoinset() JoinManager Methods Get the list of lookup services that have currently been joined. LookupLocator[] getlocators() Get the list of locators of specific lookup services to join. modifyattributes(entry[] attrsettemplates, Entry[] attrsets) modifyattributes(entry[] attrsettemplates, Entry[] attrsets, boolean checksc) removegroups(string[] groups) removelocators(lookuplocator[] locators) setattributes(entry[] attrsets) setgroups(string[] groups) setlocators(lookuplocator[] locators) terminate() Doc 18, Simple Jini Example Slide # 16

10 10 of 10 11/13/2007 7:35 AM Copyright, All rights reserved SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA USA. OpenContent license defines the copyright on this document. Previous visitors since 18-Mar-99 Next

JAVA RMI. Remote Method Invocation

JAVA RMI. Remote Method Invocation 1 JAVA RMI Remote Method Invocation 2 Overview Java RMI is a mechanism that allows one to invoke a method on an object that exists in another address space. The other address space could be: On the same

More information

Remote Method Invocation

Remote Method Invocation Remote Method Invocation A true distributed computing application interface for Java, written to provide easy access to objects existing on remote virtual machines Provide access to objects existing on

More information

RMI. Remote Method Invocation. 16-Dec-16

RMI. Remote Method Invocation. 16-Dec-16 RMI Remote Method Invocation 16-Dec-16 The network is the computer Consider the following program organization: method SomeClass call AnotherClass returned object computer 1 computer 2 If the network is

More information

CA341 - Comparative Programming Languages

CA341 - Comparative Programming Languages CA341 - Comparative Programming Languages David Sinclair There are 3 common memory models: RAM Random Access Memory is the most common memory model. In programming language terms, this means that variables

More information

Written by: Dave Matuszek

Written by: Dave Matuszek RMI Remote Method Invocation Written by: Dave Matuszek appeared originally at: http://www.cis.upenn.edu/~matuszek/cit597-2003/ 28-May-07 The network is the computer * Consider the following program organization:

More information

Implementing Jini Servers without Object Serialization Support

Implementing Jini Servers without Object Serialization Support Implementing Jini Servers without Object Serialization Support Tero Hasu Helsinki University of Technology Telecommunications Software and Multimedia Laboratory tero.hasu@hut.fi Abstract Jini is a technology

More information

Distributed Systems/Middleware JavaSpaces

Distributed Systems/Middleware JavaSpaces Distributed Systems/Middleware JavaSpaces Alessandro Sivieri Dipartimento di Elettronica e Informazione Politecnico, Italy sivieri@elet.polimi.it http://corsi.dei.polimi.it/distsys Slides based on previous

More information

Designing an Interactive Jini Service

Designing an Interactive Jini Service Chap04.fm Page 96 Tuesday, May 22, 2001 3:11 PM Designing an Interactive Jini Service Topics in This Chapter Designing distributed services The importance of interfaces in defining services Using utility

More information

Chapter 18: CORBA and Jini. Contents

Chapter 18: CORBA and Jini. Contents of 23 27/04/2013 6:07 PM 18.1. CORBA Chapter 18: CORBA and Jini CORBA CORBA to Java Mapping Jini Proxies Simple Example Corba Server in Java Corba Client in Java Jini Service Jini Server and Client Building

More information

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University CS 555: DISTRIBUTED SYSTEMS [RMI] Frequently asked questions from the previous class survey Shrideep Pallickara Computer Science Colorado State University L21.1 L21.2 Topics covered in this lecture RMI

More information

Jini-based Management

Jini-based Management Jini-based Management Part I: Jini Peer Hasselmeyer Department of Computer Science Darmstadt University of Technology http://www.ito.tu-darmstadt.de Java Intelligent Network Infrastructure Jini Is Not

More information

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2) Introduction Objective To support interoperability and portability of distributed OO applications by provision of enabling technology Object interaction vs RPC Java Remote Method Invocation (RMI) RMI Registry

More information

Communicating with JMX agents. Using the RMI adapter from Sun Creating a Jini connector Creating a TCP adapter

Communicating with JMX agents. Using the RMI adapter from Sun Creating a Jini connector Creating a TCP adapter 9 Communicating with JMX agents Using the RMI adapter from Sun Creating a Jini connector Creating a TCP adapter 187 188 CHAPTER 9 Communicating with JMX agents You had your first exposure to working with

More information

1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void

1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void 1 interface TemperatureSensor extends java.rmi.remote 2 { 3 public double gettemperature() throws java.rmi.remoteexception; 4 public void addtemperaturelistener ( TemperatureListener listener ) 5 throws

More information

Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma. Distributed and Agent Systems RMI

Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma. Distributed and Agent Systems RMI Agent and Object Technology Lab Dipartimento di Ingegneria dell Informazione Università degli Studi di Parma Distributed and Agent Systems RMI Prof. Agostino Poggi What is RMI? Its acronym means Remote

More information

Title: DISTRIBUTED COMPUTING USING JINI -Example Author: Elango Sundaram

Title: DISTRIBUTED COMPUTING USING JINI -Example Author: Elango Sundaram Title: DISTRIBUTED COMPUTING USING JINI -Example Author: Elango Sundaram Abstract: The following discussion covers an example JINI deployment. The classes involved and an overall implementation method

More information

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01

Introduction & RMI Basics. CS3524 Distributed Systems Lecture 01 Introduction & RMI Basics CS3524 Distributed Systems Lecture 01 Distributed Information Systems Distributed System: A collection of autonomous computers linked by a network, with software to produce an

More information

CS 5523 Operating Systems: Remote Objects and RMI

CS 5523 Operating Systems: Remote Objects and RMI CS 5523 Operating Systems: Remote Objects and RMI Instructor: Dr. Tongping Liu Thank Dr. Dakai Zhu and Dr. Palden Lama for providing their slides. Outline Distributed/Remote Objects Remote object reference

More information

CSci Introduction to Distributed Systems. Communication: RPC In Practice

CSci Introduction to Distributed Systems. Communication: RPC In Practice CSci 5105 Introduction to Distributed Systems Communication: RPC In Practice Linux RPC Language-neutral RPC Can use Fortran, C, C++ IDL compiler rpgen N to generate all stubs, skeletons (server stub) Example:

More information

Distributed Systems. 5. Remote Method Invocation

Distributed Systems. 5. Remote Method Invocation Distributed Systems 5. Remote Method Invocation Werner Nutt 1 Remote Method Invocation 5.1 Communication between Distributed Objects 1. Communication between Distributed Objects 2. RMI 2 Middleware Middleware

More information

BA (Hons) Degree in Computing Final Year Project Report (2001/2002)

BA (Hons) Degree in Computing Final Year Project Report (2001/2002) BA (Hons) Degree in Computing Final Year Project Report (2001/2002) A Framework for an Agent-based Development Environment with Jini / JavaSpace Internet Integrated Development Environment Framework (Internet-IDEF)

More information

RMI (Remote Method Invocation) Over the year, there have been 3 different approaches to application development:

RMI (Remote Method Invocation) Over the year, there have been 3 different approaches to application development: RMI (Remote Method Invocation) History: Over the year, there have been 3 different approaches to application development: 1. the traditional approach. 2. the client / server approach and 3. the component-

More information

5.4. Events and notifications

5.4. Events and notifications 5.4. Events and notifications Distributed event-based systems extend local event model Allowing multiple objects at diff. locations to be notified of events taking place at an object Two characteristics:

More information

Last Class: Network Overview. Today: Distributed Systems

Last Class: Network Overview. Today: Distributed Systems Last Class: Network Overview =>Processes in a distributed system all communicate via a message exchange. Physical reality: packets Abstraction: messages limited size arbitrary size unordered (sometimes)

More information

Page 1. CS 194: Distributed Systems Distributed Coordination-based Systems. Coordination Systems. Taxonomy of Coordination Models

Page 1. CS 194: Distributed Systems Distributed Coordination-based Systems. Coordination Systems. Taxonomy of Coordination Models Coordination Systems CS 194: Distributed Systems Distributed Coordination-based Systems Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences

More information

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A Contents Java RMI G53ACC Chris Greenhalgh Java RMI overview A Java RMI example Overview Walk-through Implementation notes Argument passing File requirements RPC issues and RMI Other problems with RMI 1

More information

Remote Objects and RMI

Remote Objects and RMI Outline Remote Objects and RMI Instructor: Dr. Tongping Liu Distributed/Remote Objects Remote object reference (ROR) Remote Method Invocation (RMI) Case study and example: Java RMI Other issues for objects

More information

Jini Smart Sensor Application In Mobile Interactive Data Acquisition System (MIDAS)

Jini Smart Sensor Application In Mobile Interactive Data Acquisition System (MIDAS) Jini Smart Sensor Application In Mobile Interactive Data Acquisition System (MIDAS) A PROJECT Submitted to Oregon State University Yun Ge In partial fulfillment of the requirement of The requirements for

More information

CALIFORNIA SOFTWARE LABS

CALIFORNIA SOFTWARE LABS Wrapping Jini Services in ActiveX CALIFORNIA SOFTWARE LABS R E A L I Z E Y O U R I D E A S California Software Labs 6800 Koll Center Parkway, Suite 100 Pleasanton CA 94566, USA. Phone (925) 249 3000 Fax

More information

Distributed Systems. 02r. Java RMI Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017

Distributed Systems. 02r. Java RMI Programming Tutorial. Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017 Distributed Systems 02r. Java RMI Programming Tutorial Paul Krzyzanowski TA: Long Zhao Rutgers University Fall 2017 1 Java RMI RMI = Remote Method Invocation Allows a method to be invoked that resides

More information

RMI. (Remote Method Invocation)

RMI. (Remote Method Invocation) RMI (Remote Method Invocation) Topics What is RMI? Why RMI? Architectural components Serialization & Marshaled Objects Dynamic class loading Code movement Codebase ClassLoader delegation RMI Security Writing

More information

Distributed Systems. 6. Remote Method Invocation. Werner Nutt

Distributed Systems. 6. Remote Method Invocation. Werner Nutt Distributed Systems 6. Remote Method Invocation Werner Nutt 1 Remote Method Invocation 6.1 Communication between Distributed Objects 1. Communication between Distributed Objects 2. Java RMI 3. Dynamic

More information

How are classes loaded into the Java Virtual Machine (JVM)? from the local file system (CLASSPATH). by an instance of ClassLoader

How are classes loaded into the Java Virtual Machine (JVM)? from the local file system (CLASSPATH). by an instance of ClassLoader 36 ClassLoader How are classes loaded into the Java Virtual Machine (JVM)? from the local file system (CLASSPATH). by an instance of ClassLoader... and when? - When they are needed the first time. class

More information

presentation DAD Distributed Applications Development Cristian Toma

presentation DAD Distributed Applications Development Cristian Toma Lecture 8 S4 - Core Distributed Middleware Programming in JEE presentation DAD Distributed Applications Development Cristian Toma D.I.C.E/D.E.I.C Department of Economic Informatics & Cybernetics www.dice.ase.ro

More information

Jini Technology Overview

Jini Technology Overview Jini Technology Overview Bob Scheifler Senior Staff Engineer Sun Microsystems, Inc Talk outline very brief Jini overview Jini lookup service in some depth service types and type matching attributes and

More information

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture session Desarrollo de Aplicaciones en Red José Rafael Rojano Cáceres http://www.uv.mx/rrojano RMI Remote Method Invocation Introduction Java RMI let s work calling remote methods. Underneath it works with

More information

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9,

Distributed Systems. Distributed Object Systems 2 Java RMI. Java RMI. Example. Applet continued. Applet. slides2.pdf Sep 9, Distributed Object Systems 2 Java RMI Piet van Oostrum Distributed Systems What should a distributed system provide? Illusion of one system while running on multiple systems Transparancy Issues Communication,

More information

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414 The UNIVERSITY of EDINBURGH SCHOOL of INFORMATICS CS4/MSc Distributed Systems Björn Franke bfranke@inf.ed.ac.uk Room 2414 (Lecture 3: Remote Invocation and Distributed Objects, 28th September 2006) 1 Programming

More information

Pini A Jini-Like Plug&Play Technology for the KVM/CLDC

Pini A Jini-Like Plug&Play Technology for the KVM/CLDC Pini A Jini-Like Plug&Play Technology for the KVM/CLDC Dipl.-Inform. Steffen Deter and Dipl.-Inform. Karsten Sohr University of Marburg Department of Mathematics and Computer Science deter,sohr@mathematik.uni-marburg.de

More information

RMI Example RMI. CmpE 473 Internet Programming RMI

RMI Example RMI. CmpE 473 Internet Programming RMI CmpE 473 Internet Programming Pınar Yolum pinar.yolum@boun.edu.tr Department of Computer Engineering Boğaziçi University RMI Examples from Advanced Java: Internet Applications, Art Gittleman Remote Method

More information

CS193k, Stanford Handout #12. Threads 4 / RMI

CS193k, Stanford Handout #12. Threads 4 / RMI CS193k, Stanford Handout #12 Spring, 99-00 Nick Parlante Threads 4 / RMI Semaphore1 Semaphore1 from last time uses the count in a precise way to know exactly how many threads are waiting. In this way,

More information

JAVA RMI Java, summer semester

JAVA RMI Java, summer semester JAVA RMI Overview Remote Method Invocation usage of remote object objects in a different VM (on the same computer or over the network) as there would be local objects (almost) calls just take longer time

More information

Department of Computer Science & Engineering. M.Tech(CSE)-I Year-II Semester WEB SERVICES AND SERVICE ORIENTED ARCHITECHTURE (B1513) Mr.K.

Department of Computer Science & Engineering. M.Tech(CSE)-I Year-II Semester WEB SERVICES AND SERVICE ORIENTED ARCHITECHTURE (B1513) Mr.K. Department of Computer Science & Engineering M.Tech(CSE)-I Year-II Semester WEB SERVICES AND SERVICE ORIENTED ARCHITECHTURE (B1513) By Mr.K.Yellaswamy Assistant Professor CMR College of Engineering & Technology,

More information

Troubleshooting Jini Configuration Problems

Troubleshooting Jini Configuration Problems CHAPTER 2 Troubleshooting Jini Configuration Problems JINI IS ADVERTISED AS network plug and work, which carries the idea of zero administration, where you buy a device, switch it on, and voila it is there

More information

CC755: Distributed and Parallel Systems

CC755: Distributed and Parallel Systems CC755: Distributed and Parallel Systems Dr. Manal Helal, Spring 2016 moodle.manalhelal.com Lecture 7: Remote Method Invocation (RMI) 1 RMI Y Daniel Liang, Introduction to JAVA Programming, 9th Edition,

More information

Firewall Issues. The possible scenarios: the RMI client, the server, or both can be operating from behind a firewall

Firewall Issues. The possible scenarios: the RMI client, the server, or both can be operating from behind a firewall Firewall Issues Firewalls are inevitably encountered by any networked enterprise application that has to operate beyond the confines of an Intranet Typically, firewalls block all network traffic, with

More information

Question1 (10 points) : Patron Aggregator

Question1 (10 points) : Patron Aggregator NSY102 Une idée de solution Conception de logiciels Intranet : Patrons et Canevas. Session de Juillet 2010-durée : 2 heures Tous documents papiers autorisés Cnam / Paris-HTO & FOD Sommaire : Question 1

More information

DISTRIBUTED OBJECTS AND REMOTE INVOCATION

DISTRIBUTED OBJECTS AND REMOTE INVOCATION DISTRIBUTED OBJECTS AND REMOTE INVOCATION Introduction This chapter is concerned with programming models for distributed applications... Familiar programming models have been extended to apply to distributed

More information

Lab 2 : Java RMI. request sayhello() Hello interface remote object. local object. response "Hello world"

Lab 2 : Java RMI. request sayhello() Hello interface remote object. local object. response Hello world Lab 2 : Java RMI 1. Goals In this lab you will work with a high-level mechanism for distributed communication. You will discover that Java RMI provides a mechanism hiding distribution in OO programming.

More information

Distributed Systems COMP 212. Lecture 10 Othon Michail

Distributed Systems COMP 212. Lecture 10 Othon Michail Distributed Systems COMP 212 Lecture 10 Othon Michail RMI: Remote Method Invocation Allows an object running in one Java virtual machine to invoke methods on an object running in another Java virtual machine.

More information

Developing RMI Based Server (ChatServer)

Developing RMI Based Server (ChatServer) Introduction Developing RMI Based Server (ChatServer) In the last module, we have learnt about RMI. In this module we will look at how to create an interactive application like chat server using RMI. Demo

More information

Distributed Computing

Distributed Computing Distributed Computing Computing on many systems to solve one problem Why? - Combination of cheap processors often more cost-effective than one expensive fast system - Flexibility to add according to needs

More information

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course JAC444 - Lecture 11 Remote Method Invocation Segment 2 - Develop RMI Application 1 Remote Method Invocation In this lesson you will be learning about: Designing RMI application Developing distributed object

More information

1 Shyam sir JAVA Notes

1 Shyam sir JAVA Notes 1 Shyam sir JAVA Notes 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write

More information

Today: More Case Studies DCOM

Today: More Case Studies DCOM Today: More Case Studies DCOM Jini Lecture 24, page 1 DCOM Distributed Component Object Model Microsoft s object model (middleware) Lecture 24, page 2 DCOM: History Successor to COM Developed to support

More information

Communication Basics, RPC & RMI. CS403/534 Distributed Systems Erkay Savas Sabanci University

Communication Basics, RPC & RMI. CS403/534 Distributed Systems Erkay Savas Sabanci University Communication Basics, RPC & RMI CS403/534 Distributed Systems Erkay Savas Sabanci University 1 Communication Models 1. Remote Procedure Call (RPC) Client/Server application 2. Remote Method Invocation

More information

Remote Method Invocation Benoît Garbinato

Remote Method Invocation Benoît Garbinato Remote Method Invocation Benoît Garbinato 1 Fundamental idea (1) Rely on the same programming paradigm for distributed applications as for centralized applications In procedural languages, we will rely

More information

RMI Case Study. A Typical RMI Application

RMI Case Study. A Typical RMI Application RMI Case Study This example taken directly from the Java RMI tutorial http://java.sun.com/docs/books/tutorial/rmi/ Editorial note: Please do yourself a favor and work through the tutorial yourself If you

More information

Remote Method Invocation. Benoît Garbinato

Remote Method Invocation. Benoît Garbinato Remote Method Invocation Benoît Garbinato Fundamental idea (1) Rely on the same programming paradigm for distributed applications as for centralized applications In procedural languages, we will rely on

More information

IBD Intergiciels et Bases de Données

IBD Intergiciels et Bases de Données IBD Intergiciels et Bases de Données RMI-based distributed systems Fabien Gaud, Fabien.Gaud@inrialpes.fr Overview of lectures and practical work Lectures Introduction to distributed systems and middleware

More information

-LQL. Peer Hasselmeyer Darmstadt University of Technology. Friedemann Mattern ETH Zürich. Andreas Zeidler Darmstadt University of Technology

-LQL. Peer Hasselmeyer Darmstadt University of Technology. Friedemann Mattern ETH Zürich. Andreas Zeidler Darmstadt University of Technology -LQL Peer Hasselmeyer Darmstadt University of Technology Friedemann Mattern ETH Zürich Andreas Zeidler Darmstadt University of Technology -DYD,QWHOOLJHQW 1HWZRUN,QIUDVWUXFWXUH -LQL,V 1RW,QLWLDOV -LQL Infrastructure

More information

Distributed Systems Project 4 Assigned: Friday March 20 Due: Friday April 3, 11:59pm

Distributed Systems Project 4 Assigned: Friday March 20 Due: Friday April 3, 11:59pm 95-702 Distributed Systems Project 4 Assigned: Friday March 20 Due: Friday April 3, 11:59pm Project Topics: Java RMI and a distributed, Mobile to Cloud application This project has 2 tasks. Task 1 is a

More information

Remote Method Invocation

Remote Method Invocation Non-101samples available here: https://github.com/101companies/101repo/tree/master/languages/aspectj/javarmisamples Remote Method Invocation Prof. Dr. Ralf Lämmel Universität Koblenz-Landau Software Languages

More information

Course Snapshot. The Next Few Classes

Course Snapshot. The Next Few Classes Course Snapshot We have covered all the fundamental OS components: Architecture and OS interactions Processes and threads Synchronization and deadlock Process scheduling Memory management File systems

More information

Distributed Objects SPL/ SPL 201 / 0 1

Distributed Objects SPL/ SPL 201 / 0 1 Distributed Objects 1 distributed objects objects which reside on different machines/ network architectures, benefits, drawbacks implementation of a remote object system 2 Why go distributed? large systems

More information

Network. Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark

Network. Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark Network Dr. Jens Bennedsen, Aarhus University, School of Engineering Aarhus, Denmark jbb@ase.au.dk Outline Socket programming If we have the time: Remote method invocation (RMI) 2 Socket Programming Sockets

More information

2/23/04 Doc 10 State & Chain of Responsibility slide # 1

2/23/04 Doc 10 State & Chain of Responsibility slide # 1 2/23/04 Doc 10 State & Chain of Responsibility slide # 1 CS 635 Advanced Object-Oriented Design & Programming Spring Semester, 2004 Doc 10 State & Chain of Responsibility Contents State... 2 Example -

More information

CS 580 Client-Server Programming Fall Semester, 2005 Doc 12 Configuration Files & Logging Contents

CS 580 Client-Server Programming Fall Semester, 2005 Doc 12 Configuration Files & Logging Contents 3/2/05 Doc 12 Configuration Files & Logging slide # 1 CS 580 Client-Server Programming Fall Semester, 2005 Doc 12 Configuration Files & Logging Contents Application Parameters & Configuration Files...3

More information

Remote Method Invocation

Remote Method Invocation Remote Method Invocation RMI Dr. Syed Imtiyaz Hassan Assistant Professor, Deptt. of CSE, Jamia Hamdard (Deemed to be University), New Delhi, India. s.imtiyaz@jamiahamdard.ac.in 1 Agenda Introduction Creating

More information

CSC Java Programming, Fall Java Data Types and Control Constructs

CSC Java Programming, Fall Java Data Types and Control Constructs CSC 243 - Java Programming, Fall 2016 Java Data Types and Control Constructs Java Types In general, a type is collection of possible values Main categories of Java types: Primitive/built-in Object/Reference

More information

Course Snapshot. The Next Few Classes. Parallel versus Distributed Systems. Distributed Systems. We have covered all the fundamental OS components:

Course Snapshot. The Next Few Classes. Parallel versus Distributed Systems. Distributed Systems. We have covered all the fundamental OS components: Course Snapshot The Next Few Classes We have covered all the fundamental OS components: Architecture and OS interactions Processes and threads Synchronization and deadlock Process scheduling Memory management

More information

IJESRT. http: //

IJESRT. http: // IJESRT [Monika,1(4): Jun., 2012] INTERNATIONAL JOURNAL OF ENGINEERING SCIENCES & RESEARCH TECHNOLOGY Innovative Techniquee of Message Passing In Loosely Coupled System Monika Arya* Department of Computer

More information

2/17/04 Doc 8 Adapter & Strategy slide # 1

2/17/04 Doc 8 Adapter & Strategy slide # 1 2/17/04 Doc 8 Adapter & Strategy slide # 1 CS 635 Advanced Object-Oriented Design & Programming Spring Semester, 2004 Doc 8 Adapter & Strategy Contents Adapter...2 Motivating Adapter...2 Adapter...6 Consequences...10

More information

4/29/03 Doc 25 C# Arrays, Indexers & Exceptions slide # 1

4/29/03 Doc 25 C# Arrays, Indexers & Exceptions slide # 1 4/29/03 Doc 25 C# Arrays, Indexers & Exceptions slide # 1 CS 683 Emerging Technologies Spring Semester, 2003 Doc 25 C# Arrays, Indexers & Exceptions Contents Arrays... 2 Aystem.Array... 6 Properties...

More information

Java Programming Language Advance Feature

Java Programming Language Advance Feature Java Programming Language Advance Feature Peter.Cheng founder_chen@yahoo.com.cn http://www.huihoo.com 2004-04 Huihoo - Enterprise Open Source http://www.huihoo.com 1 Course Goal The main goal of this course

More information

Programming - 2. Common Errors

Programming - 2. Common Errors Common Errors There are certain common errors and exceptions which beginners come across and find them very annoying. Here we will discuss these and give a little explanation of what s going wrong and

More information

Info 408 Distributed Applications Programming Exercise sheet nb. 4

Info 408 Distributed Applications Programming Exercise sheet nb. 4 Lebanese University Info 408 Faculty of Science 2017-2018 Section I 1 Custom Connections Info 408 Distributed Applications Programming Exercise sheet nb. 4 When accessing a server represented by an RMI

More information

Verteilte Systeme (Distributed Systems)

Verteilte Systeme (Distributed Systems) Verteilte Systeme (Distributed Systems) Karl M. Göschka Karl.Goeschka@tuwien.ac.at http://www.infosys.tuwien.ac.at/teaching/courses/ VerteilteSysteme/ Lecture 3: Communication (Part 2) Remote Procedure

More information

Component-Based Software Engineering

Component-Based Software Engineering Component-Based Software Engineering Remote Method Invocation Paul Krause Introduction to RMI Lecture 11 - RMI Simple Example - DivideServer Demo of this example Review a more complex example - StudentEnrollment

More information

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration

Chapter 15: Distributed Communication. Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration Chapter 15: Distributed Communication Sockets Remote Procedure Calls (RPCs) Remote Method Invocation (RMI) CORBA Object Registration Sockets Defined as an endpoint for communcation Concatenation of IP

More information

Linda, JavaSpaces & Jini

Linda, JavaSpaces & Jini ECE 451/566 - Introduction to Parallel and Distributed Computing Linda, JavaSpaces & Jini Manish Parashar parashar@ece.rutgers.edu Department of Electrical & Computer Engineering Rutgers University Linda

More information

Remote Method Invocation Java RMI & Web-Services

Remote Method Invocation Java RMI & Web-Services Remote Method Invocation Java RMI & Web-s CS 4119 - Computer Networks Columbia University - Spring 2003 Alexander V. Konstantinou akonstan@cs.columbia.edu Introduction : Remote Computation Objects encapsulate

More information

Self-test Java Programming

Self-test Java Programming Self-test Java Programming Document: e0883test.fm 16 January 2018 ABIS Training & Consulting Diestsevest 32 / 4b B-3000 Leuven Belgium TRAINING & CONSULTING INTRODUCTION TO THE SELF-TEST JAVA PROGRAMMING

More information

JavaSpaces Specification

JavaSpaces Specification JavaSpaces Specification The JavaSpaces technology package provides a distributed persistence and object exchange mechanism for code written in the Java programming language. Objects are written in entries

More information

Programming with the Service Control Engine Subscriber Application Programming Interface

Programming with the Service Control Engine Subscriber Application Programming Interface CHAPTER 5 Programming with the Service Control Engine Subscriber Application Programming Interface Revised: July 28, 2009, Introduction This chapter provides a detailed description of the Application Programming

More information

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

(800) Toll Free (804) Fax   Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days Course Description This course introduces the Java programming language and how to develop Java applications using Eclipse 3.0. Students learn the syntax of the Java programming language, object-oriented

More information

Programming with the Service Control Engine Subscriber Application Programming Interface

Programming with the Service Control Engine Subscriber Application Programming Interface CHAPTER 5 Programming with the Service Control Engine Subscriber Application Programming Interface Revised: November 20, 2012, Introduction This chapter provides a detailed description of the Application

More information

COMP 6231: Distributed System Design

COMP 6231: Distributed System Design COMP 6231: Distributed System Design Remote Invocation and RMI Based on Chapters 5, 7 of the text book and the slides from Prof. M.L. Liu, California Polytechnic State University COMP 6231, Fall 2013 Remote

More information

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI 03 Remote invocation Request-reply RPC Coulouris 5 Birrel_Nelson_84.pdf RMI 2/16 Remote Procedure Call Implementation client process Request server process client program client stub procedure Communication

More information

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question)

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question) CS/B.TECH/CSE(New)/SEM-5/CS-504D/2013-14 2013 OBJECT ORIENTED PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give their answers

More information

Java RMI Activation: A running example We have the following classes: MyRemoteInterface: the remote interface. Client: the client that invokes a

Java RMI Activation: A running example We have the following classes: MyRemoteInterface: the remote interface. Client: the client that invokes a Java RMI Activation: A running example We have the following classes: MyRemoteInterface: the remote interface. Client: the client that invokes a method on the remote object. ActivableImplementation: the

More information

Distributed object component middleware I - Java RMI

Distributed object component middleware I - Java RMI Prof. Dr. Claudia Müller-Birn Institute for Computer Science, Networked Information Systems Distributed object component middleware I - Java RMI Nov 15th, 2011 Netzprogrammierung (Algorithmen und Programmierung

More information

Lecture VI: Distributed Objects. Remote Method Invocation

Lecture VI: Distributed Objects. Remote Method Invocation Lecture VI: Distributed Objects. Remote Method Invocation CMPT 401 Summer 2007 Dr. Alexandra Fedorova Remote Method Invocation In an object-oriented language (usually Java) A way to call a method on an

More information

Distributed object component middleware I - Java RMI

Distributed object component middleware I - Java RMI Prof. Dr. Claudia Müller-Birn Institute for Computer Science, Networked Information Systems Distributed object component middleware I - Java RMI Nov 15th, 2011 Netzprogrammierung (Algorithmen und Programmierung

More information

CS 116 Week 8 Page 1

CS 116 Week 8 Page 1 CS 116 Week 8: Outline Reading: 1. Dale, Chapter 11 2. Dale, Lab 11 Objectives: 1. Mid-term exam CS 116 Week 8 Page 1 CS 116 Week 8: Lecture Outline 1. Mid-term Exam CS 116 Week 8 Page 2 CS 116 Week 8:

More information

CSCI 355 Lab #2 Spring 2007

CSCI 355 Lab #2 Spring 2007 CSCI 355 Lab #2 Spring 2007 More Java Objectives: 1. To explore several Unix commands for displaying information about processes. 2. To explore some differences between Java and C++. 3. To write Java applications

More information

Distributed Programming in Java. Distribution (2)

Distributed Programming in Java. Distribution (2) Distributed Programming in Java Distribution (2) Remote Method Invocation Remote Method Invocation (RMI) Primary design goal for RMI is transparency Should be able to invoke remote objects with same syntax

More information

BSc ( Hons) Computer Science with Network Security. Examinations for / Semester 2

BSc ( Hons) Computer Science with Network Security. Examinations for / Semester 2 BSc ( Hons) Computer Science with Network Security Cohort: BCNS/16B/FT Examinations for 2017 2018 / Semester 2 Resit Examinations for BCNS/15B/FT & BCNS/16A/FT MODULE: NETWORK PROGRAMMING MODULE CODE:

More information

Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws

Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws Lecture 14 Summary Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws 1 By the end of this lecture, you will be able to differentiate between errors, exceptions,

More information

Enterprise JavaBeans. Session EJBs

Enterprise JavaBeans. Session EJBs Enterprise JavaBeans Dan Harkey Client/Server Computing Program Director San Jose State University dharkey@email.sjsu.edu www.corbajava.engr.sjsu.edu Session EJBs Implement business logic that runs on

More information