Oreifej-Stricklan

advertisement
Jini™
Rashad Oreifej
and
Christopher Stricklan
Introduction
►
Pronounced GEE-nee



Stands for (Java INference engine and networked Interactor)?
Loosely derived from the Arabic for magician?
Some said it stands for Jini Is Not Initials 
Nobody really knows..
►
An open Java™ technology-based architecture enables
organizations to build adaptive network-centric systems to
allow services to be added, upgraded or removed
dynamically, whilst the network remains up and running
►
“Plug and Work” network
History
► Developed
by Sun MicroSystems
► The
idea started by Sun cofounder Bill Joy at Sun
Aspen Smallworks R&D lab in 1994
► Under
the leadership of Bill Joy and Jim Waldo:
 Ann Wollrath
 Ken Arnold
 Bob Scheifler
History
►
Based on the unique distributed computing characteristics
of Java technology and the RMI
►
Introduced in January, 1999 by providing the first Jini
Technology Starter Kit
►
Sun currently has agreement with a wide range of
technology companies to develop Jini technology services,
both hardware and software.
 Includes Axis, Canon, Datek, Epson, FedEx, Mitsubishi, Norwest
Mortgage, Novell, ODI, Quantum, Seagate, Toshiba, Computer
Associates, Oki, Salomon Brothers
Benefits
► Provides
the infrastructure for creating dynamically
networked components (SW/HW), applications,
and services
► No
configuration overhead and device drivers
► Extends
the Java programming model to the
network (moves data and executables via a Java
object over a network)
► Consistent
access to local and remote devices
Benefits
►
Network self-healing and self-configuration (Leasing)
►
Networks adapt to changes in the computing environment
►
Allows fast, easy incorporation of legacy, current, and future network
components
►
Jini is available free of charge
►
Enables computer networks to resemble phone networks in graceful
connection/disconnection and scalability
►
Enables all types of digital devices to work together in a community
put together without extensive planning, installation, or human
intervention
Limitations
► Sun
Community Source License (SCSL)
licensing model
► Lookup
criteria that include ranges of values
to match or sets of values to match, cannot
be expressed with a single ServiceTemplate
► Low-resource
clients
Success Stories
►
Orange API 2 incorporates Jini technology as one of the first
implementations of Jini in telephony network Web services
environment
►
RFID networks enable and support new business processes. Such a
distributed network benefits from Jini’s robust self-managing and selfhealing capabilities
►
U.S. Army developed a battlefield-ready solution based on Jini
connection technology that allows computers and other devices to
interoperate immediately after being connected.
►
Other many success stories:
http://www.sun.com/software/jini/news/success.xml
Jini Logical Architecture
Jini Technology Flow Diagram
Jini Flow Example
Jini Architecture Diagrams
Implementation Components
► jini-core
► jini-ext
}
Discovery, Lookup, Lease, …
Implementations
► Reggie
-
LUS Implementation
► jsk-policy
-
Security Implementation
► Many
others…
Lookup Discovery Service (LDS)
► Unicast
Discovery Protocol (Locator)
 For LUS outside the LAN
 Address is already known
► Multicast
Discovery Protocol (Group)
 LUS within the LAN
 Address in not known.
Unicast Discovery Protocol
►
Package: net.jini.core.discovery
►
Client/service sends a unicast request (packet) using the
TCP protocol Unicast TCP
►
LUS unicast announcement reply Unicast TCP
►
Client/Service downloads the LUS proxy
►
Join (Send proxy class, Service ID, Attributes) Unicast TCP
►
Lookup (Obtain RMI interface to service) Unicast TCP
Multicast Discovery Protocol
►
Package: net.jini.discovery
►
Client/service sends a multicast request (packet) that
contains the groups of interest Multicast UDP
►
LUS multicast announcement reply Multicast UDP
►
Client/Service downloads the LUS proxy
►
Join (Send proxy class, Service ID, Attributes) Unicast TCP
►
Lookup (Obtain RMI interface to service) Unicast TCP
Jini Lookup
► Lookup
types “Templates” rather than names
► Lookup
by a class type “Super and Sub classes can
be included”
► Lookup
by multiple types (AND/OR operators)
► Lookup
by specific attributes
► Lookup
by Service ID
Lease Service
►
Leasing concept is introduced to recover from the loss of
services
►
Prevents resource starving at the LUS due to allocations for
dead services
►
Each service is registered in the LUS for a certain time
“Lease”
►
Upon expiry either renew, or be removed
►
Lease requester can cancel the lease any time
Distributed Events
Distributed Events
Distributed Events
► Discover
an instance of a LUS
► Register
with the LUS in order to be notified
when a specific service (template) joins and
leaves the Jini network
► Catch
the join and leave remote
notifications from the LUS
Code Snippet Examples
► Unicast
Lookup
import net.jini.core.discovery.LookupLocator;
public class Locator{
public Locator{
LookupLocator lookup;
try{
lookup = new LookupLocator(“jini://localhost”);
}catch(java.net.MalformedURLException e){
}
}
}
Code Snippet Examples
► Get
Registrar
… // Other imported packages
import net.jini.core.lookup.ServiceRegistrar;
public class UnicastRegister{
public UnicastRegister{
LookupLocator lookup = null;
ServiceRegistrar registrar = null;
… // Lookup Service code here
try{
registrar = lookup.getRegistrar();
}catch(){}
}
}
Code Snippet Examples
► Register
a Service
… // Other imported packages
import net.jini.core.lookup.ServiceItem;
import net.jini.core.lookup.ServiceRegistration;
Public class SimpleService implements Serializable{
public SimpleService(){
… //Lookup Service Code
… // Registrar Code
ServiceItem item = new ServiceItem(null, this, null);
ServiceRegistration reg = null;
try{
reg = registrar.register(item, 10000); // Registers for 10 seconds
}catch(jama.rmi.RemoteException e){}
}
}
Code Snippet Examples
► Consume
a Service
// First we need an Interface
public interface Toaster extends java.io.Serializable{
public void setDarkness(int dark);
public void startToasting();
}
// The actual also needs to be implemented
public class MySuperToaster implements Toaster{
public void setDarkness(int dark){
… // do something here
}
public void startToasting(){
… // Lets make the toast yummy
}
}
Code Snippet Examples
► Consume
a Service contd.
// Set a security manager otherwise we can’t load the codebase
System.setSecurityManager(new RMISecurityManager());
Class[] toasterClasses = new Class[1];
toasterClasses[0] = Toaster.class;
… // Do the usual Lookup and Registrar Creation
// Prepare a seach template of serviceID, classes and entries
ServiceTemplate template = new ServiceTemplate(null, toaterClasses, null);
// Let us find the Toaster
Toaster toaster = null;
try{
toater = (Toaster) registrar.lookup(template);
}catch(javam.rmi.RemoteException e){}
JINI Framework-based Services
► JavaSpaces






based on Tuple-Spaces
Provides a reliable distributed storage system for objects
Supports atomic access to objects
Built-in transactional mechanism
Object Leases
Events
JINI Framework-based Services
► Rio




Dynamically instantiate service component
Monitor service component
Manage service component
Pluggable load distribution and resource utilization
analysis
JINI Framework-based Services
► Seven
 Eases the development and deployment of Jini services
 Administration interfaces for life-cycle and join
management
 Role based access control for remote method
invocations
 Security is dynamically configurable/reconfigurable
 Resource efficiency by reducing the number of threads
that are used by the Jini classes
JINI Framework-based Services
► Harvester





Claims to simplify Jini application development
Build services using a servlet-like API
Help manages codebase
Provides an HTTP server for codebase downloads
Supports writing Jini services with Python through a
wrapper class called Jython
JINI Framework-based Services
► Newton




Moves code around the network installing on demand
Removes the code when no longer in use
Dynamically wires up runtime service dependencies
Rewires dependencies as services come and go.
Applications
► Distributed
File System
► Directory Service
► Mobile Networks
► Auto Printer Configuration
► RFID
► Agent Implementations
► Grid Computing
Apache River
Moved Jini from SCSL to Apache License v2.0 (ALv2)
Occurred March 2005
► Why
Apache?
 It was a community decision
 Extensive, open, and collaborative discussions
 ALv2 was determined to best meet the licensing
requirements most important to Sun and the Jini
Community.
Apache River
► Motivation
 Allow Broader Adoption
 Technical Advancement
 Meet needs of expanding Jini community
Apache River
► Benefits
 Develops a richer ecosystem for Jini technology users to
operate within
 Freely license, use and distribute Jini technology
 Simplify prospective users license review process
 Simplify the introduction of Jini technology into many
companies
Other SOAs
► Zero
Configuration Networking (Zeroconf)
Created by The Engineering Task Force
IPv4 Link-Local Addressing Based
Allocate addresses without a DHCP server
Translate between names and IP addresses without a
DNS server
 Find services, like printers, without a directory server




Other SOAs
► Bonjour







Created by Apple
Based off of ZeroConf
Open Source
Creates dynamic network of computers
JAVA library, MAC OS, and Windows Compatible
IP Based through UDP Port 5353
Allows discovery of services through web browser
Other SOAs
► UPnP
Created by Microsoft
Supports zero-cofiguration
Media and Device Independent
Platform Independence
Built on internet-based technologies (IP, TCP, UDP,
HTTP, XML, etc.)
 Extendable





Conclusions
► Jini




Developed by SUN
Dynamic Networking Architecture
Zero Configuration
Remote Method Invocation
Conclusions
► Pros







Create a Dynamic Environment
Open Source
Cross-Platform Support
Mobility of Code
Protocol Agnostic
Network Self-Healing
Network Self-Configuration
Conclusions
► Cons
 Lookup Criteria
 Limited Debugging Support
 Type conflicts when mixing objects from different code
bases
 Changes in codebase may fail to reach client
References
1.
2.
3.
4.
5.
6.
7.
http://www.jini.org
Jini and JavaSpaces Application Development, Robert
Flenner. SAMS Publishing, 2002
The Power and Limitations of the ServiceRegistrar
Interface, Bill Venners. Published in JavaWorld, 2000
http://www.sun.com/software/jini/news/success.xml
www.assuredtech.com/papers/jini/embedded.pdf
www.sun.com/software/jini/whitepapers/jinidatasheet0601.pdf
http://www.javacoffeebreak.com/books/samples/professi
onaljini/3552_Chap7_idx.pdf
References
http://developer.apple.com/opensource/internet/bonjour.
html
9.
http://www.apple.com/support/downloads/bonjourforwin
dows.html
10. http://www.zeroconf.org/
11. http://msdn2.microsoft.com/en-us/library/aa382261.aspx
12. http://www.sun.com/software/jini/index.xml
13. A Programmer’s Guide to Jini Technology, Jan Newmarch,
Apress, 2000
14. Class Loading Issues in Java™ RMI and Jini™ Network
Technology, Michael Warres, Sun Microsystems, 2006
8.
References
https://rio.dev.java.net/overview.html
16. http://www.cheiron.org/seven/
17. https://harvester.dev.java.net/
18. http://newton.codecauldron.org/
19. https://rio.dev.java.net/
15.
Download