Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jini Tutorial, Part 2 Jini Overview.

Similar presentations


Presentation on theme: "Jini Tutorial, Part 2 Jini Overview."— Presentation transcript:

1 Jini Tutorial, Part 2 Jini Overview

2 Tutorial outline Part 1 Introduction Part 2 Overview of Jini Part 3
Distributed systems Java basics Remote Method Invocation (RMI) Part 2 Overview of Jini Goals Architecture Basic concepts, protocols Part 3 Jini Programming Part 4 Advanced topics Mobile Jini access Adaptive user interfaces Security

3 Why Jini? Distributed computing is more difficult than local computing because of: Network latency, Concurrency issues, Memory management, Partial failure.

4 Jini goals Jini™ Network Technology by Sun Microsystems “Plug-and-use”
A device should instantly usable when plugged into the network, just like a phone set – no installation, etc should be required Reliable service-based architecture Spontaneous networking based on discovery and mobile code Self-healing Erase the distinction between hardware and software (everything is a service) Protocol-independence To make writing distributed programs easier.

5 Properties Based on the Java programming language.
Homogeneous network Architecture independence Dynamic environment Programming interfaces designed for robustness. Services may come and go without administration. Federation, not central control. Jini can be used with both hardware as well as software services: Everything is represented by Java Objects. Everything is located and accessed through Java Interfaces.

6 Tutorial outline Part 1 Introduction Part 2 Overview of Jini Part 3
Distributed systems Java basics Remote Method Invocation (RMI) Part 2 Overview of Jini Goals Architecture Basic concepts, protocols Part 3 Jini Programming Part 4 Advanced topics Mobile Jini access Adaptive user interfaces Security

7 Key participants Service Client Lookup Service
A service is an entity that another program, service or user can use. It can be a piece of computation, a hardware device or software. Client A Jini device or component that becomes the member of the federation in order to use a Jini service. Lookup Service The central element of a Jini federation. The lookup service (also known as the service locator or service registrar) keeps track of the services offered in the federation. Repository of available services. Stores each service as Java objects. Clients download services on demand.

8 Basic terms Spontaneous networking Federation Discovery Leasing
Communication is established dynamically without installing drivers and carrying out manual configuration Federation A set of software components and devices creating a distributed system that are part of a Jini network at a given time. Discovery The mechanism used to locate lookup services in order to advertise a new service in the network or find a service for use. Leasing Jini services grant resource usage in a time-based manner. If the period of the grant (lease) is not renewed before its expiration, the grant will be withdrawn at the end of the period. Distributed event Components of a Jini system can notify each other when some change in their state occurs. Transaction

9 Jini Technologies

10 Jini Architecture Jini Network services Applications JavaSpaces
Other services Network services Lookup Jini Discovery/Join RMI Java Java Java Solaris Solaris Solaris Mac Windows SPARC PowerPC x86

11 Jini Extends the Java Platform

12 Jini Operation The fundamental behaviour is defined by three protocols
Discovery – how to locate the Lookup Service Join – how to register with the LS and export services Lookup – how to find suitable services Main operation steps Services export their services (in the form of Java objects) Clients locate services and download objects or execution Client-Service interaction (formation of a federation) is governed by need

13 Jini Operation (cont’d)
Lookup services are dynamically discovered by clients and services Services register service proxies in JLUSs Clients lookup and download service proxies from discovered JLUSs by interface and/ or attributes Lookup Service A Lookup Service B Jini Service backend service proxy ServiceItem ServiceID serviceID Object service Entry[] attributeSets Jini Client template

14 The notion of groups Group Aut Group IRT Group KNT LUS 3: Aut
LUS 1: IRT LUS 5: IRT, KNT LUS 6: Aut, KNT LUS 4: Aut LUS 2: IRT

15 Tutorial outline Part 1 Introduction Part 2 Overview of Jini Part 3
Distributed systems Java basics Remote Method Invocation (RMI) Part 2 Overview of Jini Goals Architecture Basic concepts, protocols Part 3 Jini Programming Part 4 Advanced topics Mobile Jini access Adaptive user interfaces Security

16 The discovery protocol
Two forms of discovery Multicast, using UDP multicast Finding services at unknown but multicast-reach locations using group names Unicast, using TCP/IP Finding services at known locations URL: jini://hostname:port/ Forms Client discovery At startup; problem with latecomer services Service announcement At startup; problem with latecomer clients

17 Multicast discovery protocol

18 Multicast announcement protocol

19 Unicast discovery protocol

20 Join protocol (services)
Wait randomly at startup Up to 15 sec Perform unicast discovery with known LUSs If groups ≠{} perform multicast for given groups Register with discovered and/or announced LUSs Perform periodic lease renewal On connection failure Re-register with persistent LUSs Forget multicast discovered ones, wait for announcement Making changes Attribute change with all registered LUSs Register/unregister with specific LUSs Join/leave groups If a service is asked to join a group, it adds the name of that group to the persistent set of groups to join and either starts or continues to perform multicast discovery using this augmented group. If the service is requested to leave a group, the steps are a little more complex: 1. It removes that group from the persistent set of groups to join. 2. It removes all lookup services that match only that group in the set of groups it is interested in from the set it has discovered using multicast discovery, and unregisters from those lookup services. 3. It either continues to perform multicast discovery with the reduced set of groups or, if the set has been reduced to empty, ceases multicast discovery.

21 Lookup protocol Client creates template Sends template to LUS
Describes the type of service sought after Sends template to LUS LUS performs template matching LUS returns result 1 or more ServiceItem objects

22 Matching Strict matching Match if Using marshalled objects
Comparing fields Match if A) identical serviceIDs (tmpl can be null) and B) item service is instance of every tmpl service types and C) item attributes contain at least one match for each attribute in tmpl ServiceID Set of service interfaces Set of attribute objects ServiceTemplate ServiceID Object implementing interfaces Set of attribute objects ServiceItem

23       Examples 2 null Template 1 null Template 2 1 Printer
Location(VE,IRT) PrinterProp(15,colour) Service null Fax Template 3 null Printer Template 4 null Printer Location(VE,KNT) Template 5 2 Printer Location(VE,IRT) PrinterProp(null, colour) Template 6

24 Leasing Problem Traditional solution: system administration:
Partial failure in distributed systems can lead to unchecked resource consumption. Traditional solution: system administration: Error-prone, Costly, Only happens when it is too late.

25 What are Leases? Time-based grants of resources or services.
Provides a method of managing resources in an environment where network failures can, and do, occur Loose contracts between grantor and holder. Negotiated for a set period of time. Can be shared or exclusive.

26 Distributed events in Jini
Enables Java event model to work in a distributed network. Register interest, receive notification. Allows for use of event managers. Can use numerous distributed delivery models: Push, pull, filter... Uses leasing protocol.

27 Transaction model in Jini
Designed for distributed object coordination: light weight, object-oriented. Supports: Nested transactions; Various levels of ACID properties (Atomicity, Consistency, Isolation, Durability). Uses leasing protocol. Implemented in Transaction Manager service – another Jini service (mahalo).

28 Nested Transactions

29 More Information The Jini Specification Home pages Online tutorials
Online tutorials pandonia.canberra.edu.au/java/jini/tutorial/ Jini.xml ch04.html notes/index.html

30 Books (not all)


Download ppt "Jini Tutorial, Part 2 Jini Overview."

Similar presentations


Ads by Google