JINI Spontaneous Networking in Java - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

JINI Spontaneous Networking in Java

Description:

playing piano, running and, of course, partecipating at the JUG activities! ... A very good and clear series of lessons about JINI ... – PowerPoint PPT presentation

Number of Views:71
Avg rating:3.0/5.0
Slides: 23
Provided by: jugto
Category:

less

Transcript and Presenter's Notes

Title: JINI Spontaneous Networking in Java


1
Java User Group Torino
JINISpontaneous Networking in Java
Third Part Discovery and Join in-depth.
JUG_at_Webbit, Padova 9-10-11 Maggio 2003
2
Topics
  • In-depth view of Discovery
  • In-depth view of Join
  • The DEMO

3
About the JUG
  • The JUG was born in February 2002 by the idea of
    some Java fans in the Torino area
  • The aim of the group is to promote the knowledge
    exchange between members and to create an
    important community in the landscape of Italian
    Java programmers
  • Participating is free and voluntary
  • You can participate at the meeting, write
    articles, expose your doubts, ask for support etc
    etc .... .... ....

4
Who am I?
  • Renzo Borgatti is a Java developer since 2000
  • I was involved in several projects during my
    activity mainly focused on server side Java and
    J2EE
  • I spend the rest of my time (too short!) playing
    piano, running and, of course, partecipating at
    the JUG activities!
  • Feel free to contact me at renzo.borgatti_at_jugtorin
    o.it

5
The discovery phase
6
Network concepts
DISCOVERY
  • Multicast special addresses of the IP range from
    224.0.0.0 to 239.255.255.255
  • Unicast the classic communication model where
  • UDPUser Datagram Protocol runs on the top of the
    IP. A connectionless, unreliable, datagram packet
    service
  • TCP a reliable, stream oriented full duplex
    connection

7
Kind of discovery
DISCOVERY
  • Multicast Discovery Request
  • Multicast reqUDP from the e. to the l.s.
  • Unicast resTCP from the l.s. to the e.
  • Multicast Discovery Announcement
  • Multicast reqUDP from the l.s. to the e.
  • Unicast reqTCP from the e. to the l.s.
  • Unicast resTCP from the l.s. to the e.
  • Unicast Discovery Request
  • Unicast reqTCP from the e. to the l.s.
  • Unicast resTCP from the l.s. to the e.
  • Unicast Discovery Announcement
  • Unicast reqTCP from the l.s. to the e.
  • Unicast reqTCP from the e. to the l.s.
  • Unicast resTCP from the l.s. to the e.

8
Discovery overview
DISCOVERY
JVM
9
Multicast request
DISCOVERY
10
Unicast response
DISCOVERY
11
Request datagram format
DISCOVERY
12
The Join phase
13
Overview
JOIN
  • JINI entities have already found the lookup
    service
  • In the Join phase, JINI entities start using the
    lookup service functionality
  • Services register themselves
  • Clients lookup services by interface

14
The ServiceRegistrar interface
JOIN
  • The method register() can be used by services to
    join or re-join the federation
  • The service passes as a parameter a
    net.jini.core.lookup.ServiceItem object group
  • Service object (the interface of the service
    exposed to the clients of the service)
  • Attributes (any other objects needed to interact
    with the service such as icons, GUI elements and
    so forth)
  • Returns a net.jini.core.lookup.ServiceRegistration
    which is a container for registration
    information (such as ServiceID)

15
Registring services
JOIN
At the end ...
16
Lookup
JOIN
17
End of the Lookup
JOIN
18
JINI Packages
  • net.jini.core. --gt The core Jini classes
  • net.jini. --gt contains libraries built using
    core packages
  • com.sun.jini. --gt a set of helper classes
    considered non-standard and subject to change

19
Demo...
20
Some considerations
  • When a client asks for a service in JINI
    federation has to assume that the services it
    wants have a common and well known interface
  • This is because a client lookups a service by the
    mean of Java types (interfaces)
  • How can I make such an assumption?
  • For example how my client could find a printer
    service if it doesn't know nothing about that
    printer interface? Printer service can be
    different from federation to federation

21
What a JINI client has to worry about?
  • A client doesnt need to know
  • how the service is implemented (the class
    implementation will be loaded at runtime)
  • if the service is remote and how the service
    communicates with the remote skeleton (it depends
    on the implementation)
  • how dependent classes (classes the client needs
    to run the service) appear into the classpath
  • Otherwise a client needs to
  • have services interfaces in the classpath
  • Know how service behaves
  • Have jini-core.jar library in the classpath

22
Resources
Write a Comment
User Comments (0)
About PowerShow.com