THE JINI TECHNOLOGY Alessio Zumbo

Download Report

Transcript THE JINI TECHNOLOGY Alessio Zumbo

THE JINI TECHNOLOGY
Alessio Zumbo
[email protected]
Index
Middleware
Jini intro
Service
Lookup Service
RMI
Leasing
Transactions
Events
Components
Index
The infrastructure
The programming model
Discovery Join & Lookup
Middleware
• Is a layer between network operating
systems and application components.
Application component
Middleware
Network operating system
Middleware requirements
• Scalability
• Openness
• Heterogeneity
• Fault-tollerance
• Resource sharing
Jini intro (1/3)
Jini is a technology that is based on Java and
Tcp-IP and that, using net protocols, allows
to put in communication different objects
between they in an only one network.
Jini intro (2/3)
In practical, every time that a new device
comes connected to the circuit, before
announces who is and what is in a position
to making and then it explains as it must be
used, through it’s interface.
Jini intro (3/3)
• As an example a printer, in the moment in which it
is connected to a Jini community, before will be
introduced and then it will as an example expose to
its interface, containing the service print.
• If subsequently a Jini refrigerator must have need
to print a page, it will be sufficient that it goes to
search who, in the community, puts to disposition
the service print and then to demand the execution.
Service (1/3)
• A service can be computation, memory, a
communication channel, a dispositive hardware, or
an other customer.
• Two examples of services are: to print a document
and translate a document from a format to an other.
• A system of Jini would not have to be believed like
with about clients and server, or customers and
programs, or programs and databases, rather, a Jini
system consists to accomplish one particular
operation.
Service (2/3)
The dynamics nature of a Jini system allows to
the services of being added or withdraws to
you anytime.
Jini supplies the mechanisms for the
construction, the search, the communication
and the use of the services of the distributed
system.
Service (3/3)
• The services in a Jini system communicate
between they using a protocol, that it is with
of interfaces written in the language of Java
programming.
Lookup Service (1)
• The services are find from the Lookup
Service, which it is not other that a table
containing the interfaces that describe the
functionalities of the present services in the
Jini community.
Lookup Service (2)
• In adding are stored attributes, that they
serve in order to specify in more complete
way the service. Typical attributes are the
name, the description and the location.
Lookup Service (3)
• A service is added to the Lookup Service
using two protocols calls to you discovery
and join: in the first place the service
characterizes the Lookup Service (using the
protocol discovery) and then it joins to it
(using the protocol join).
Java Remote Method
Invocation (RMI) (1/2)
• The communication between the services
happens using Remote Method Invocation
(RMI) supplied from Java. RMI not only
allows to transfer gives to you from an
object to other through the net, but also
complete objects, comprised the code.
Java Remote Method
Invocation (RMI) (2/2)
• Great part of the semplicity of the Jini
system is concurred from this ability to
move the code, encapsulated in to the object
, through the net.
Leasing (1/4)
• The access to many of the services in to the
environment Jini is based on the leasing. A
leasing is one concession of access
guaranteed for a sure period of time.
Leasing (2/4)
• Every leasing is negotiates between the
petitioner and the supplier of the service:
– a service is asked for a sure period;
– the access it is assigned for a sure time, possibly
holding in consideration the demanded period.
Leasing (3/4)
• If a leasing is not renewed before that it is
exausted, or because the resource is not
more necessary, or client or the net comes to
lack, or it is not allowed with the leasing of
being renewed, then the resource can be
freed.
Leasing (4/4)
• The leasing can be of two types: exclusive
or not exclusive;
• exclusive assure that no other can use the
resource (to obtain an other leasing) during
the period of the leasing, those, instead,
• not exclude, allows a shared use to you of
the resource (is granted more leasing on the
same resource).
Transactions (1/3)
• A series of operations, to the inside of single
service or reported more services, can be
inglobate in one transaction. A transaction is
indivisible in unity of execution; therefore
or the operations of a transaction come
executed all, or the transaction must not
have some effect on the system.
Transactions (2/3)
• In particular Jini in order to guarantee a
transaction uses the protocol of commit to
two is made (two-phase commit). Such
protocol remembers, in its essential lines, a
wedding, the decision of two persons comes
ratified collection and from a third person,
that it celebrates the wedding.
Transactions (3/3)
• So that the wedding has place, is necessary
that both the participants express their will
to marry themselves; celebrating, during the
first phase, collects desire to marry itself
separately, express from the two
participants, in order then, in a second
phase, to give they news that the wedding
has happened.
Events
• The Jini architecture supports the distributed
events.
• An object can allow that other objects are
recorded to particular events of the object
and receive a notification in the case happen
such event.
Components (1/3)
• The members of a Jini system can be
segmetated in three categories the
infrastructure, the model of programming
and the services. The infrastructure is with
of the members whom the development of
the federation system Jini allows, while the
services are the entities to the inside of the
federation.
Components (2/3)
• The programming model the set of the
interfaces that the construction of reliable
services allows, comprised those that make
part of the infrastructure and those that join
the federation.
• These three categories, although
distinguished and separable, are interlaced to
such point that their distinction can seem
little clear.
Components (3/3)
• Is possible to develop systems that they have
some of the functionalities of the Jini system
with of varying in all and the three
categories.
The infrastructure
• The technological infrastructure of Jini includes
the following: a distributed security system,
integrated with RMI, that extends the model of
emergency of the Java platform to the world of the
distributed systems; discovery and join protocols,
service protocols that concur with the service to
discover, become part, and inform the other
members of the federation; lookup service, that
serve like a warehouse of services, it's a table
where the lines are objects written in Java.
The infrastructure (1/2)
• The technological infrastructure of Jini includes
the following: a distributed security system,
integrated with RMI, that extends the model of
emergency of the Java platform to the world of the
distributed systems; discovery and join protocols,
service protocols that concur with the service to
discover, become part, and inform the other
members of the federation; lookup service, that
serve like a warehouse of services, it's a table
where the lines are objects written in Java.
The infrastructure (2/2)
The programming model
• The interfaces that compose the model of
programming of Jini are the following:
– leasing interface: it defines a way in order to allot and
free the resources using a rinnovabile model and based
on the duration;
– event and notification interface: they are an extension
of the model of event used in the JavaBeans members
for distributed systems, they allow the communication
based on the events between Jini services;
– transaction interface: allows a group of services to
cooperate second the approach of the transactions in
such way that the change made from the group happens
in atomic way.
Discovery Join & Lookup
(1/5)
• The heart of the Jini system is a trio of
protocols called discovery, join, and lookup.
A pair of these protocols—discovery and
join—occur when a device is plugged in.
Discovery Join & Lookup
(2/5)
• Discovery occurs when a service is looking
for a lookup service with which to register.
• Join occurs when a service has located a
lookup service and wishes to join it.
• Lookup occurs when a client or user needs
to locate and invoke aservice described by
its interface type (written in the Java
programming language) and possibly other
attributes.
Discovery Join & Lookup
(3/5)
Discovery Join & Lookup
(4/5)
Discovery Join & Lookup
(5/5)