Date post: | 30-Dec-2015 |
Category: |
Documents |
Upload: | jade-hopkins |
View: | 220 times |
Download: | 3 times |
JINIJINI
Java Intelligent Network Infra-structure
Gijung Yun© Realtime Embedded Systems Laboratory
Inha University
© 2002, Gijung Yun, RESL, Inha University Page : 2
JINI
Contents
Introduction – Vision and Charicteristic
Jini Environment Jini Infrastructure Jini Architecture
1. RMI 2. Discovery, join and lookup3. Leasing 4. Events5. Transaction 6. Services7. Entry 8. Security
© 2002, Gijung Yun, RESL, Inha University Page : 3
JINI
Introduction
Jini Goals– Network plug and work– Enable spontaneous networking– Promote service-based architecture– Simplicity– Resources can be implemented as
either hardware devices, software programs, or a combination of the two.
© 2002, Gijung Yun, RESL, Inha University Page : 4
JINI
© 2002, Gijung Yun, RESL, Inha University Page : 5
JINI
관련 기술– UPnP
MS, Compaq, Intel, Philips…
– HAVi Sony, Philips, Samsung, Sun… 가정내 AV 기기를 접속하는 기술
© 2002, Gijung Yun, RESL, Inha University Page : 6
JINI
Characteristic – 100% Pure Java – Collection of API’s and Protocols
Infrastructure Built on RMI Discovery, Join and Service Protocols Lookup Service
Programming Model Leasing Interface Event and Notification Interfaces Transaction Interfaces
Services Fundamental entity of Jini
– Reference Implementations Supplied
© 2002, Gijung Yun, RESL, Inha University Page : 7
JINI
Jini Environment
Java 2 compatible VM Network of reasonable speed
– Multicast support preferable– Initial support for TCP/IP only
Class file server– HTTP most commonly used
Dynamic address allocation– DHCP
Devices should have some memory and CPU– Can use a ‘proxy’ as an alternative
© 2002, Gijung Yun, RESL, Inha University Page : 8
JINI
Jini Infrastructure
Windows UnixOther OS or Devices
Java VM
Boot, Discover, Join
RMI
JavaSpaces
Directory Services
Jini
It is a set of software layers that together create a federation of computer devices and services
© 2002, Gijung Yun, RESL, Inha University Page : 9
JINI
Jini Architecture
RMI Discovery, Join & Lookup Leasing Events Transactions Services
© 2002, Gijung Yun, RESL, Inha University Page : 10
JINI
RMI
Remote Method Invocation Object-Oriented RPC
– Similar to CORBA Distinguished by ability to parse
objects by value
© 2002, Gijung Yun, RESL, Inha University Page : 11
JINI
Discovery, Join and Lookup
Discovery– Find a Lookup Service
Multicast UDP for nearby Lookup services Unicast TCP for known Lookup services
Join– Used by services to register with a Lookup S
ervice– Registration Utility Classes
LookupDiscover for multicast discovery LookupLocator for unicast discovery
© 2002, Gijung Yun, RESL, Inha University Page : 12
JINI
Lookup
– Repository of available services– Stores each service as Java objects– Clients and services use to request a
service type from a Lookup service Search by type(Java Interface), not
name Closer to CORBA Trader service than
CORBA Naming service
© 2002, Gijung Yun, RESL, Inha University Page : 13
JINI
Discovery and Join
Jini LookupService
J
J
ServiceProvider
512 byteDiscoveryMulticast
RMIReferenceJoin Upload
출처 : Sun
© 2002, Gijung Yun, RESL, Inha University Page : 14
JINI
Lookup
RMIReference
LookupDownload
Jini LookupService
ServiceConsumer
J
J
ServiceProvider
Discovery
J
출처 : Sun
© 2002, Gijung Yun, RESL, Inha University Page : 15
JINI
DiscovererLookupService
Request Message(sent via UDP multicast)
Response Message(sent via TCP unicast)
DiscovererLookupService
Announcement Message(sent via UDP multicast)
Request Message(sent via TCP unicast)
Response Message(sent via TCP unicast)
© 2002, Gijung Yun, RESL, Inha University Page : 16
JINI
Vers<int>
Port<int>
GroupLen
<int>
Group 1<string>
Group 2<string>
…
Where the discoverer wants repliesSent to
Desired groups(length == 0 all)
HeardLen
<int>
Heard 1<svc id>
Heard 2<svc id>
…Known LookupServices
Request packet format
© 2002, Gijung Yun, RESL, Inha University Page : 17
JINI
Announcement packet format
Vers<int>
Host<string>
Port<int>
My Id<svc id>
GroupLen
<int>
Group 1<string>
Group 2<string>
…
Service information(header)
Groups that I am amember of
© 2002, Gijung Yun, RESL, Inha University Page : 18
JINI
Lookup Services
Maps interfaces indicating the functionality provided by a service to sets of objects that implement the service
JJ
Object
StorePrint
CopierFaxPrinter
HPCanon
BJC-70LBP-1260
BJ-100J
Service must be serialisableand implement Entry
출처 : Sun
© 2002, Gijung Yun, RESL, Inha University Page : 19
JINI
May be federated with other lookup services
Lookup service interface provides:– Registration, Access, Search,
Removal
© 2002, Gijung Yun, RESL, Inha University Page : 20
JINI
Network Issue– IP-based– Request Packet size limitation
(512Byte)– Limiting the scope of multicast
TTL ( recommend 15 )
© 2002, Gijung Yun, RESL, Inha University Page : 21
JINI
Distributed Leasing
A form of Distributed ‘Garbage Collection’– Enables stability and resilience
Service is ‘loaned’ to a client for a certain period of time
Delegation of Lease Renewal– Allows clients/services to delegate
lease renewal to a third party object
© 2002, Gijung Yun, RESL, Inha University Page : 22
JINI
Attribute Modification– If a service is asked to change the set
of attributes with which it registers itself,
– it saves the changed set in a persistent store, then performs the requested change at each lookup service with which it is registered.
© 2002, Gijung Yun, RESL, Inha University Page : 23
JINI
Registering and Unregistering with Lookup Services– register with lookup service
adds that lookup service to the persistent set of lookup services it should join,
and then registers itself with that lookup service.
– unregister from lookup service service is in the persistent set of lookup
services to join, it should be removed from that set.
the service cancels the leases for all entries it maintains at that lookup service.
© 2002, Gijung Yun, RESL, Inha University Page : 24
JINI
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.
© 2002, Gijung Yun, RESL, Inha University Page : 25
JINI
leaving a group– It removes that group from the persistent
set of groups to join.– 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.
– 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.
© 2002, Gijung Yun, RESL, Inha University Page : 26
JINI
Distributed Events
Extends the standard Java event model– Adds features to provide resilience and determinati
on in a distributed environment Registration for event notifications is lease based Unique event identifiers assigned to every event supplier Event sequence numbers assigned to every event Event types
– Marshaled Object enables: Store-and-forward Notification filter Notification MailBox
© 2002, Gijung Yun, RESL, Inha University Page : 27
JINI
Transactions
Set of Interfaces that support the implementation of a two-phase commit protocol– Designed to be lightweight
Left to developer to implement as much (or as little) of the transactional semantics as they need
Lease based - transaction will fail if not completed within leased period
– Supports distributed transactions– Sample Implementation supplied in Jini distribution
© 2002, Gijung Yun, RESL, Inha University Page : 28
JINI
출처 : Sun
© 2002, Gijung Yun, RESL, Inha University Page : 29
JINI
Services Services are defined by their interface Services must:
– Discover and register with a lookup service(s)– Maintain the following across failures:
ServiceID(128bit) assigned by a lookup service The service attributes that define its lookup entry The group(s) the service participates in Specific lookup services it must participate in
– Maintain all leases with lookup services they have registered with
Utility Classes provided to manage these responsibilities
© 2002, Gijung Yun, RESL, Inha University Page : 30
JINI
Using a Service– Communication is between service
and its proxy– Independent of wire protocol– Protocol can change without affecting
client– RMI semantics core to functionality
© 2002, Gijung Yun, RESL, Inha University Page : 31
JINI
Entry
Typed set of objects, for matching Provides extra information about services A service may have any number of entries Clients request services by class and/or by
entries, using a simple matching system Drawback:
– relational operators such as < and != are not supported
© 2002, Gijung Yun, RESL, Inha University Page : 32
JINI
There are some convenience subclasses of Entry:– Address: the address of the physical component of a
service.
– Location: the location of the physical component of a service. It can be used alone in a small, local organization.
– Comment: a free-form comment about the service.
– Name: name(s) of the service as seen by users.
– ServiceInfo: generic information about a service. Includes the name of the manufacturer, the product, and the vendor.
– ServiceType: human-oriented information about the "type" of a service. This is not related to its data or class types.
– Status: the base class from which other status-related entry classes may be derived.
© 2002, Gijung Yun, RESL, Inha University Page : 33
JINI
Security The design of the security model for Jini
technology is built on the twin notions of a principal and an access control list.
Jini services are accessed on behalf of some entity—the principal—which generally traces back to a particular user of the system.
Whether access to a service is allowed depends on the contents of an access control list that is associated with the object (entity).
© 2002, Gijung Yun, RESL, Inha University Page : 34
JINI
The Sun Community Source License (SCSL)
Three Levels of Participation– Research and Education
Source code freely available Can be used in any way other than deployment
– Internal Deployment Deployed code must pass a compatibility test
– Commercialisation Source code available with Jini trademark for a branding fe
e Branding fee covers cost of trademark protection and com
patibility testing Low cost fee is based on either annual fee or royalty per d
evice/service sold - whichever is the lower
© 2002, Gijung Yun, RESL, Inha University Page : 35
JINI
Summary
Jini limitations– TCP/IP, multicast, Java RMI, Java 2 VM
Jini philosophy is useful
© 2002, Gijung Yun, RESL, Inha University Page : 36
JINI
Reference
Web Sites– http://www.jini.org/– http://java.sun.com/jini– http://java.sun.com/products/javaspaces