1 / 19

11. Jini What is Jini?

interface implementation. interface. published service object (proxy of service).

Download Presentation

11. Jini What is Jini?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. interface implementation interface published service object (proxy of service) A "network technology that provides a simple (?) infrastructure for delivering services in a network and for creating interactions between programs that use these services regardless of their hardware/software implementation. " (http://www.sun.com/jini/). More specifically it is a set of APIs and protocols for building and deploying distributed systems organized as a federation of services. Any service, irrespective of its implementation, communicates through an interface; the implementation can use any hardware or software appropriate for this service:  erasing the hardware/software distinction, abstracting interface and implementation or object-oriented network programming. 11. Jini What is Jini? private network protocol Service Client CS 667: 11. Jini Zlateva

  2. Network Plug-and-Work Note that in the preceding diagram, the set up is as for RMI. This is no accident: in fact the inter object communication is through RMI. What Jini provides are protocols how to get to this point. Jini views the "computer" as a collections of services available on the network, that a client program brings together to perform some computational task. Instead of thinking of a computer as a stand alone that executes after being booted from a disc (disc-centered), one should think of a computing node that executes after being plugged into a network  "The network is the computer!", network plug-and-work. "Any kind of network made up of services (applications, databases, servers, devices, information systems, mobile appliances, storage, printers, etc.) and clients (requesters of services) of those services can be easily assembled, disassembled, and maintained on the network using Jini Technology. Services can be added or removed from the network, and new clients can find existing services - all without administration.(?!)" (http://www.sun.com/jini/) CS 667: 11. Jini Zlateva

  3. printer disk image processor database database client camera What is Jini? – A Technology for Building Federation of Services The services are not subject to a central control:  federation of services. Instead of a central control, Jini provides mechanisms for client and services to find each other:  "spontaneous networking", service-based architecture, self organizing system. Federation of Services computation A computation B Jini is not an acronym: it comes from "genie" (the one in the bottle) and can be thought of as "Jini Is Not Initials" CS 667: 11. Jini Zlateva

  4. How Does Jini Work? – Defining and Advertising Services • A serviceis defined by its programming API, declared as a Java programming language interface; • A service is implemented using whatever protocol is appropriate for this service, e.g. a proprietary protocol, XML, RMI, CORBA, etc.; the client program using the service does not care about the network protocol used in the implementation. • In order to be plugged into a network of Jini technology-enabled services and/or devices, a service advertises itself by publishing a Java programming language object that implements the service API. This object's implementation can work in any way the service chooses, e.g. execute locally at client site, remotely on server site, or have parts of local and remote execution. CS 667: 11. Jini Zlateva

  5. How Does Jini Work? – Finding and Using Services • The client finds services by looking for an object that supports the API. When it gets the service's published object, it will download any code it needs in order to talk to the service, thereby learning how to talk to the particular service implementation via the API. The programmer who implements the service chooses how to translate an API request into bits on the wire using RMI, CORBA, or a private protocol. • At this point programs and the services used by these programs have been located and a federation of services created. This has been accomplished by the Jini runtime environment. Once this task is completed, however, the federated services and programs execute independently of the Jini runtime environment. CS 667: 11. Jini Zlateva

  6. How Does Jini Work? - Notes • Note: "A Jini system should not be thought of as sets of clients and servers, or users and programs, or even programs and files. Instead, a Jini system consists of services that can be collected together for the performance of a particular task. Services may make use of other services, and a client of one service may itself be a service with clients of its own."("Jini[tm] Technology Architectural Overview", http://www.sun.com/jini/whitepapers/architecture.html) • The system is dynamic in that services can be "added or withdrawn from a federation at any time according to demand, need, or the changing requirements of the workgroup using it." ("Jini[tm] Technology Architectural Overview", http://www.sun.com/jini/whitepapers/architecture.html) CS 667: 11. Jini Zlateva

  7. Jini Extends the Java Application Environment to the Network : mechanisms for adding, removing, locating, accessing services Jini RMI : for communication between services and programs JVM Object Serialization Network Jini is Java- technology centered in that it depends on the Java application environment but not necessarily on the Java programming language. Any programming language can be supported by a Jini system if it has a compiler that produces compliant bytecodes for the Java programming language. CS 667: 11. Jini Zlateva

  8. Jini technology infrastructure defines the minimal Jini technology core. The infrastructure includes the following: • Lookup services: serve as a repositories of services. Entries in the lookup service are objects in the Java programming language; these objects can be downloaded as part of a lookup operation and act as local proxies to the service that placed the code into the lookup service • Protocols: • The discovery protocol, a network service protocol that allows client and services to locate a lookup service • The join protocol, an object service protocol that allows services to become part of, and advertise supplied services to the other members of the federation. • The lookup protocol, an object service protocol that enables client to query for services. • A distributed security system, integrated into RMI, which extends the Java platform's security model to the world of distributed systems. Jini Run Time Infrastructure CS 667: 11. Jini Zlateva

  9. Problems addressed: • a) Service wants to find lookup service to advertise itself. • b) Client wants to find lookup service to query for available services • Process: • service broadcasts a presence announcement by multicasting packet to a well known port; packet contains info for lookup service to determine whether or not to contact sender of announcement. • lookup service monitors well known port for announcements; when announcement packet received, it is inspected by the lookup service and a decision made whether or not to contact the sender; • if lookup service decides to contact sender, it does so directly through a TCP connection to the IP address and port number extracted from the packet; • lookup service sends an object, called service registrar, to service announcement originator. The service registrar objectfacilitates further communications with lookup service as follows: the originator of the service announcement performs join and lookups on the lookup service by invoking methods on the service registrar object. The Discovery Process CS 667: 11. Jini Zlateva

  10. The Join Process • Problems addressed: Service has received a server registrar object from the lookup service and wants to become part of the federation of services registered with the lookup service • Process: • service provider invokes register() method on the service registrar object, passing as parameters an object called a service item, that is a bundle of objects describing the service; • register() method sends copy of service item to the lookup service; • lookup service stores item which completes registration. • The service item is a container of objects, including • service object: typically implements one or more interfaces to be used by the client for interacting with the service; • attributes: any object, e.g. icons, GUI classes, info objects. CS 667: 11. Jini Zlateva

  11. Service (Printer) Service (Printer) Lookup Service Lookup Service service registration service object ( interface and its implementation) attributes Discovery and Join Process - Diagrams presence announcement service registrar object Discovery Join (ArOSu 1999, modified from p.5) CS 667: 11. Jini Zlateva

  12. The Lookup Process • Problem addressed: • Client wants to locate and use a service • Client has obtained a service registrar object trough the discovery process, i.e. it has located the lookup service and is ready to communicate with it. • Process: • client invokes lookup() method on service registrar object; • client passes as argument to lookup() a service template – an object that serves as search criteria for query; the service template includes the types (most often Java types, typically and interface) of services needed by client, and may also include service ID, attributes to be matched by service provider, etc. • the lookup() method sends the service template to the lookup service • lookup service performs query and sends back results. CS 667: 11. Jini Zlateva

  13. Client (Needs Printing Service) Client (Needs Printing Service) Lookup Service Service (Printer) Lookup and Using the Service - Diagram lookup service template: interface (printer) attributes service object attributes Lookup service object Using the Service - Diagram (ArOSu 1999, modified from p. 6) Note that the Jini infrastructure is not involved! CS 667: 11. Jini Zlateva

  14. Attributes • Each service object in the lookup service can have attributes, features that are not part of the interface and help distinguish between services of the same kind, e.g. the office printer vs. your very personal printer. • An attribute is an object that is an entry, i.e. it implements the net.jini.core.entry.Entry interface and has the following semantics • all non-static, non-transient, non-final fields must be public; • each field is of object type, not of primitive type • The class must be public and have a public no-arguments constructor • When the client looks up the service, it can specify the attributes. • Each attribute and attribute field can be individually marked either for matching or to be disregard by the lookup process. • Wildcards can be used and specifying more than one value means a conjunction (i.e. all specified values must be matched). CS 667: 11. Jini Zlateva

  15. Membership Management - Leasing Access to many of the services in the Jini system environment is lease based. After a service registers, the lookup service sends back a lease on its presence in the lookup service. A lease is a grant of guaranteed access over a time period. Each lease is negotiated between the user of the service and the provider of the service as part of the service protocol: A service is requested for some period; access is granted for some period, presumably taking the request period into account. If a lease is not renewed before it is freed--either because the resource is no longer needed, the client or network fails, or the lease is not permitted to be renewed--then both the user and the provider of the resource may conclude the resource can be freed. CS 667: 11. Jini Zlateva

  16. Combining Leasing and Discovery • Leases in combination with discovery allow to • keep the available services current: while the service is alive it will renew its lease. If the service crashes or the link between service and lookup service fails, the service cannot renew its lease and is dropped from the lookup service. • have a self-healing system: if service fails it is eliminated, when it comes up again it will be registered again with the lookup service; • increase robustness through self-replication: start another lookup service and the discovery process guarantees that all services will register with the new lookup service, thus replicating the existing one. CS 667: 11. Jini Zlateva

  17. Directory • Services stored by name with some convention to separate components: e.g. "devices/scanners" • System becomes confusing for large number of services and service types – subdirectories tend to grow quickly; • Naming is left to the service provider (who tends to forget the quirks of the naming hierarchy with subdirectories proliferating) and nothing prevents placing a TV in the printer directory; • To find a service one needs to • take object bound to service name • check whether it is really the service one wants; • Lookup Service • Services stored by what they really are, based on service object (interface, implementation, attributes). • System is as good as your class hierarchy, of course, but certainly will not get confusing because you lack the talent/memory for consistent naming. • No way that TV is placed among printers as it has different interface. • To find a service one needs to • take object as described by its service template, Lookup Service vs. Naming/Directory Service CS 667: 11. Jini Zlateva

  18. Jini and Legacy (Ken Arnold Seminar, 10/02/00) • Legacy services fit well into the framework • Legacy languages fit behind Java wrapping. • Jini moves cross-language membrane from the network to the address space. CS 667: 11. Jini Zlateva

  19. Jini Future (Ken Arnold Seminar, 10/02/00) • Network federation replaces the operating system • Polymorphism abstracts over network protocols • Network becomes ubiquitous and invisible • Services replace applications • References: • (ArOSu 1999) Arnolds, O'Sullivan, Sheifler, Waldo, Wollrath: The Jini Specification. Sun Microsystems & Addison-Wesley. • (DDS 2002) Deitel, H.M.; P.J.Deitel; S.E.Santry: Advanced Java 2 Platform: How to Program. Prentice Hall, 2002, Ch.22. • Jini: http://java.sun.com/products/jini • Jini Network Technology Specification: http://www.sun.com/jini/specs/ • Directory of Jini Resources: http://www.litefaden.com/sv/jd/Jini_Documentation/ CS 667: 11. Jini Zlateva

More Related