Docsity

Jini: A Java-Based Distributed Framework - Overview and Usage - Prof. William Pugh, Study notes of Programming Languages

Toggle sidebar
bg1
1
Jini
CMSC 433
2
Jini overview
• Framework and services on top of Java RMI
– finding services
• finding registries
• searching registries
• keeping registries up to date
– Distributed events
– Transactions
– JavaSpaces
• Shared store
3
Providing Services
Lookup
Service
Printer
Service
Proxy
Printer
Interface
registration
4
Finding providers
Lookup
Service
Printer
Service
Printer
Proxy
Printer
Client
Printer
Interface
Printer
Proxy
5
Using Services
Lookup
Service
Printer
Service
Printer
Proxy
Printer
Client Printer
Proxy
6
Proxies
• Java classes that implement standard
interfaces
• Classes get downloaded as needed
– From http server?
• Proxies can use any mechanism to
communicate with service
– RMI stubs, local computation and any
communication medium
pf3
pf4

Partial preview of the text

Download Jini: A Java-Based Distributed Framework - Overview and Usage - Prof. William Pugh and more Study notes Programming Languages in PDF only on Docsity!

Jini

CMSC 433

2

Jini overview

  • Framework and services on top of Java RMI
    • finding services
      • finding registries
      • searching registries
      • keeping registries up to date
    • Distributed events
    • Transactions
    • JavaSpaces
      • Shared store

3

Providing Services

Lookup Service

Printer Service

Proxy InterfacePrinter

registration

4

Finding providers

Lookup Service

Printer Service

PrinterProxy

Printer Client

InterfacePrinter PrinterProxy

5

Using Services

Lookup Service

Printer Service

PrinterProxy

Printer Client

PrinterProxy

6

Proxies

  • Java classes that implement standard interfaces
  • Classes get downloaded as needed
    • From http server?
  • Proxies can use any mechanism to communicate with service - RMI stubs, local computation and any communication medium

7

Lego Mindstorm Proxies

  • An example: Proxies for Lego Mindstorm robots
  • Processor on Mindstorm not powerful enough to host a JVM
  • Proxy can keep state about robot, communicate through infrared link

8

Lookup services

  • Broadcast looking for lookup services messages
  • Each lookup service on network responds with a proxy
  • Queries to lookup service are done through proxy - actual communication with lookup service is up to proxy

9

Using a lookup service

  • Can specify a list of classes/interfaces
    • only interested in results that are subtypes of all
  • Can specify attributes
    • Location { String building; String floor; String wing; }
    • must match all attributes (^10)

Service ID’s

  • When services first register, they are assigned a service ID - 128 GUID
  • a particular service using the same service ID on all lookup services - if you get the same service back from multiple lookup services, can detect duplicates

11

Leasing

  • When a service registers with a lookup service, it gets a limited duration lease - if lease expires without being renewed, service is de-listed
  • Service must renew lease
    • makes sure service is still up and still reachable from lookup service

12

Finding lookup services, revisited

  • When a service is activated, broadcasts request to find lookup services - using multicast over local net
  • When lookup service is activated, and at periodic intervals, broadcasts “I’m a lookup service” - services that learn about new lookup services register with them

19

JavaSpace operations

  • write - add an entry
  • read - find a matching entry
    • Can wait for matching entry (with timeout)
  • notify - add listening for matching entries
  • take - read and delete atomically

20

JavaSpace matching

  • Entry’s match just like Jini lookup attributes
  • Can provide don’t cares
  • Can use subtyping