Top Banner
JINI – 2002 AND JINI – 2002 AND BEYOND BEYOND Presented by – Gal Bernstein Article review by rk Stang & Stephen Whinston Thursday , 3/1/2002
37

JINI – 2002 AND BEYOND …

Mar 16, 2016

Download

Documents

alta

JINI – 2002 AND BEYOND …. Presented by – Gal Bernstein. Article review by – Mark Stang & Stephen Whinston. Thursday , 3/1/2002. Enterprise Computing with Jini Technology. Enterprise Computing with Jini Technology. 1. Enterprise vs. Embedded Systems. 2. The J2EE Platform. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: JINI  –  2002 AND BEYOND …

JINI – 2002 AND BEYONDJINI – 2002 AND BEYOND……

Presented by – Gal Bernstein

Article review by – Mark Stang & Stephen Whinston

Thursday , 3/1/2002

Page 2: JINI  –  2002 AND BEYOND …

Enterprise Computing with Jini TechnologyEnterprise Computing with Jini Technology

7.Coffee & Cake6.Enterprise Application Example

5.How Jini Technology Works4.Jini Advantages

3.Jini – The Final Frontier...2.The J2EE Platform

1.Enterprise vs. Embedded Systems

Page 3: JINI  –  2002 AND BEYOND …

11..Enterprise vs. EmbeddedEnterprise vs. Embedded Embedded systems are machines that contain a microprocessor,

and do a specific task or job.Examples to embedded systems are cell-phones, micro-wave ovens,navigation computers etc .

Enterprise systems are systems that contain multiple componentsand run on various (may be remote) machines, with or withoutcentral command.These are large systems in which the work is distributed among a number of machines, each doing it’s part.Examples to enterprise systems are payroll managing systems .

Page 4: JINI  –  2002 AND BEYOND …

22..The J2EE PlatformThe J2EE Platform

Components

Services

Servlets

EJB – Enterprise Java Beans

JDBC

JNDI

JMS

JTS

The JAVA 2 ENTERPRISE EDITION

Page 5: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)Servlets

Servlets are modules of Java code that run in a server application )hence the name "Servlets", similar to "Applets" on the client side (

to answer client requests .Extend javax.servlet .Used widely in web applications

Components

Page 6: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.) EJB – Enterprise Java Beans

Written in Java, an enterprise bean is a server-side component that encapsulates the business logic of an application. The business logic

is the code that fulfills the purpose of the application. In an inventorycontrol application, for example, the enterprise beans might implementthe business logic in methods called checkInventoryLevel and orderProduct. By invoking these methods, remote clients can access The inventory services provided by the application.

Benefits - First, because the EJB container provides system-level services to enterprise beans, the bean developer can

concentrate on solving business problems. The EJB container--not the bean developer--is responsible for

system-level services such as transaction management and security authorization.

Page 7: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)- Second, because the beans--and not the clients--contain the

application's business logic, the client developer can focus on the presentation of the client. The client developer does not

have to code the routines that implement business rules or access databases. As a result, the clients are thinner, a benefit

that is particularly important for clients that run on small devices.

- Third, because enterprise beans are portable components , the application assembler can build new applications from

existing beans. These applications can run on any compliant J2EE server.

Page 8: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)When To Use?

When the application has any of these requirements:- The application must be scalable. To accommodate a

growing number of users, you may need to distribute an application's components across multiple machines. Not

only can the enterprise beans of an application run on different machines, but their location will remain

transparent to the clients.

- Transactions are required to ensure data integrity . Enterprise beans support transactions, the mechanisms that

manage the concurrent access of shared objects.

- The application will have a variety of clients. With just a few lines of code, remote clients can easily locate enterprise

beans. These clients can be thin, various, and numerous.

Page 9: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)

a)Session Performs a task for a client.

b)Entity Represents a business entity object that exists in persistent storage.

c)Message-Driven Acts as a listener for the Java

Message Service API, processing messages asynchronously.

What Are The Java Beans Types:

Page 10: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.) JDBC

The JDBC API consists of a set of classes and interfaces written in Javathat provide a standard API for tool/database developers and makes it possible to write industrial strength database applications using an all-Java API.

The value of the JDBC API is that an application can access virtually any data source and run on any platform with a Java Virtual Machine.The combination of the Java platform and the JDBC API lets a programmer write once and run anywhere!

What is needed is a way for Java applications to talk to a variety of different data sources. JDBC is the mechanism for doing just this!

Page 11: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.) In simplest terms, a JDBC technology-based driver ("JDBC driver")

makes it possible to do three things: 1 .Establish a connection with a data source.

2 .Send queries and update statements to the data source. 3 .Process the results.

Page 12: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)Services

JNDI – Java Naming Directory Interface.A fundamental facility in any computing system is the naming service

--the means by which names are associated with objects and objects are found based on their names .A naming service's primary function is to map people-friendly names to objects, such as addresses, identifiers, or objects typically used by computer programs.

For example, the Internet Domain Name System (DNS) maps machine names (such as www.sun.com) to IP addresses

)such as 192.9.48.5.( The javax.naming.directory package extends the javax.naming package to provide functionality for accessing directory services in addition to naming services

Page 13: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)This package allows applications to retrieve attributes associated with objects stored in the directory and to search for objects using specified attributes .

The Java Naming and Directory Interface(JNDI) is an application programming interface (API) that provides naming and directory functionality to applications written using Java .

The JNDI architecture consists of an API and a service provider interface) SPI .(Java applications use the

JNDI API to access a variety of naming and directory services .

The SPI enables a variety of naming and directory services to

be plugged in transparently ,thereby allowing the Java application using the JNDI API to access their services .

Page 14: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.) JMS – Java Messaging Services.Messaging is a method of communication between software components or applications. The Java Message Service is a Java API that allows applications to create, send, receive, and read messages. The JMS API defines a common set of interfaces and associated semantics that allow programs written Java to communicate with other messaging implementations. The JMS API minimizes the set of concepts a programmer must learn to use messaging products, but provides enough features to support sophisticated messaging applications.The JMS API enables communication that is : Asynchronous: A JMS provider can deliver messages to a client as they arrive. Reliable: The JMS API can ensure that a message is delivered once and only once.

Page 15: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)An enterprise application provider is likely to choose a messaging API over a tightly coupled API (such as RPC) when:

- The provider wants the components not to depend on information about other components' interfaces, so that components can be easily

replaced.- The provider wants the application to run whether or not all

components are up and running simultaneously.- The application business model allows a component to send

information to another and continue to operate without receiving an immediate response.

For example, components of an enterprise application for an automobile manufacturer can use the JMS API in situations like these:

- The inventory component can send a message to the factory component when the inventory level for a product goes below a

certain level, so the factory can make more cars.

Page 16: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)- The factory component can send a message to the parts components

so that the factory can assemble the parts it needs.- The parts components in turn can send messages to their own

inventory and order components to update their inventories and order new parts from suppliers.

- Both the factory and parts components can send messages to the accounting component to update their budget numbers.

- The business can publish updated catalog items to its sales force.

Page 17: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.) JTS – Java Transaction service

A typical enterprise application accesses and stores information in one or more databases. Because this information is critical for business operations, it must be accurate, current, and reliable. Data integrity would be lost if multiple programs were allowed to simultaneously update the same information. Also, it would be lost if a system that

failed while processing a business transaction were to leave the affecteddata only partially updated. By preventing both of these scenarios ,

software transactions ensure data integrity. Transactions control the concurrent access of data by multiple programs. In the event of a systemfailure, transactions make sure that after recovery the data will be in a consistent state.To emulate a business transaction, a program may need to perform several steps. A financial program, for example, might transfer funds from a checking account to a savings account with the steps listed in the following pseudo-code:

Page 18: JINI  –  2002 AND BEYOND …

The J2EE Platform(cont.)The J2EE Platform(cont.)

Either all three of these steps must complete, or none of them at all .Otherwise, data integrity is lost. Because the steps within a transaction are a unified whole, a transaction is often defined as an indivisible unit of work.A transaction can end in two ways: with a commit or a rollback .When a transaction commits, the data modifications made by its statements are saved. If a statement within a transaction fails, the transaction rolls back, undoing the effects of all statements in the transaction.

begin transaction debit checking account

credit savings account update history log

commit transaction

Page 19: JINI  –  2002 AND BEYOND …

33..JiniJini –The Final Frontier –The Final Frontier…… Jini technology gives networks devices self-configuration and

self-management capabilities : it lets devices communicate immediately on a network without human intervention.

Self-healing : devices that leave the network for any

reason , do not effect the remaining devices’ operation.

A Jini client that loses contact with a server can recover and continue processing.

Jini technology true promise is for enterprise systems – all

because of those unique abilities that can extend beyond embedded systems.

Page 20: JINI  –  2002 AND BEYOND …

44..Jini AdvantagesJini Advantages

Reliability

Scalability

Maintenance & Administration

Security

Page 21: JINI  –  2002 AND BEYOND …

Jini Advantages (cont.)Jini Advantages (cont.)Reliability –how well does a device or network performs in

the presence of disturbances. Processes start and stop, they crash, someone

might intentionally (or not) shut them down, the machine might crash or fail…

NO PROBLEM – Jini can handle these events because it expects devices to randomly move in and out

of the network. Jini parallels the internet communication and re-routes the connection letting the client move on.

This is built in the Jini system – without that the application program must handle those tasks – major

“ bummer” for the programmer.

Page 22: JINI  –  2002 AND BEYOND …

Jini Advantages (cont.)Jini Advantages (cont.)Scalability –how much does it cost to add an attribute to a system

vs. the benefit of that attribute . Adding services, gives a Jini client more choice in the

devices he can ‘talk’ with. This, in fact, increases the systems’ reliability.

Jini networks have no central control – the whole system actually manages itself .

Jini (unlike the internet) thrives in the wild: it dynamically discovers the requested services.

Jini networks are designed to exist in a fluid environment – thus making the system more scalable .

Page 23: JINI  –  2002 AND BEYOND …

Jini Advantages (cont.)Jini Advantages (cont.)Maintenance & Administration – how convenient is it to maintain the

system alive (keep it running). Jini knows to find the components of the application,

thus making the source hidden from the client. What to do when a machine goes down?

- back up machine with the same IP.- hot fail-over

NO WORRIES – if a Jini server fails, a Jini client automatically contacts another instance of the service and moves on

with his life.

Page 24: JINI  –  2002 AND BEYOND …

Jini Advantages (cont.)Jini Advantages (cont.)Security – a critical component in an enterprise-computing environment.

The goal is preventing unknown clients from accessing protected services.

Jini can even prevent remote clients from seeing what services the network offers.

1.Viruses Jini servers provide a client the interface with which it can

access code residing on the server. This code is typically not mobile. Virus code is.

In the Jini environment, before code is moved to another machine, it must satisfy the client’s security policy.This

should allow downloading only from trusted machines, and its up to the system administrator to monitor and define

that. All system must achieve balance between perfect security and the ability to use network resources.

Page 25: JINI  –  2002 AND BEYOND …

Jini Advantages (cont.)Jini Advantages (cont.) 2.Rouge Services

What if lookup servers send clients to the wrong places? A lookup server has no way of validating if the service

that was just added himself, is actually who it claims to be..“ Bad“ servers can hijack clients and interfere with the system's

normal behavior.

This issue is still undergoing research!! – not all is perfect…

Page 26: JINI  –  2002 AND BEYOND …

55..How Jini Technology WorksHow Jini Technology Works Jini software runs on top of a Java virtual-machine and will

work in any IP-based network of machines with Java VMs. Jini technology presupposes the existence of network connecting

devices; Jini-enabled devices communicate with each other over this network.

A Jini network contains communities, or federations, or clients andservers. A Jini service joins a federation to share its service with clients. A Jini client joins a federation to gain access to services .

Federations are dynamic constructs, appearing and disappearing basedon the demands of Jini devices .

Here we’ll talk about: Service-based model.

Transferring executable code. JavaSpaces service .

Page 27: JINI  –  2002 AND BEYOND …

How Jini Technology Works (cont.)How Jini Technology Works (cont.)Service-based model

Services can be storage devices, software components ,printer, home stereo, satellite navigating systems etc. Any thing programmers can abstract through software .

Services can be clients of another jini device, and, through that, a client can build complete distributed applications .

A lookup service keeps a map between a service and his attributes. Lookup servers match services demanded by clients to the ones

advertised using those attributes .A Jini service can join multiple lookup servers!

This increases reliability and distribution. That’s excellentfor enterprise systems : a big work can be broken into piecesand calculated in remote machines, thus making it fasterand easier.(a transaction will work here – well see that later.(

Page 28: JINI  –  2002 AND BEYOND …

How Jini Technology Works (cont.)How Jini Technology Works (cont.)Transferring executable code

Jini devices transfer executable code (similar to Java appletson Web browsers). Here, the client only receives the interface,

while the work is done on the server side. The server teaches theclient how to communicate with it .

A client leases a resource for a limited time (can be renewed). Resources can be exclusive or not.

In a distributed system, transactions are vital – all or nothing. Calculations ran on different and/or remote machines must be monitored in such a manner, that a full scale operation will be

completed if and only if the whole sequence was completed successfully.

Transactions ensure consistency across the network, and Jinisupports that – especially two-phase commits that ensuresdifferent servers carry out operations consistently .

Page 29: JINI  –  2002 AND BEYOND …

How Jini Technology Works (cont.)How Jini Technology Works (cont.) With networked computers , its difficult for one

machine to find out the state of another.Event notification allows computers to notify listeners

)typically other computers on the network (of certain events. This is a simple example ofcoordinating between different computers.

Page 30: JINI  –  2002 AND BEYOND …

How Jini Technology Works (cont.)How Jini Technology Works (cont.)JavaSpaces service.

JavaSpaces is a Jini service that builds and maintains a database of Java objects : it allows storage and retrieval of objects via standard lookup .

Doesn’t have primary key.No need to create a table.Lookup through name and attributes.Relational databases operate on the C R U D interface.

CreateRead Update

Delete

Page 31: JINI  –  2002 AND BEYOND …

How Jini Technology Works (cont.)How Jini Technology Works (cont.)In JavaSpaces those actions mapped as followed:

write – performs the create and update operations.

read – returns a copy of an object.

take – combines read and delete. JavaSpaces also supports notify, which lets a program know when

an object that matches some criteria has been written into the system .

A client can take an object (thus locking it),and a transactionkeeps track that if it’s not successful (the client dies), the object will re-appear in the space (no locks and the admin can rest).

Clients (applications) use the read operation to put objects onto the JavaSpace , use it for various calculations, and return it home safely using the read operation again.

Page 32: JINI  –  2002 AND BEYOND …

6.Enterprise Application Example6.Enterprise Application Example

A License Server

Page 33: JINI  –  2002 AND BEYOND …

A License ServerA License Server Managing software licenses is a very annoying problem.

Many, many very skilled programmers have tried over the years to outsmart the cunning problem, and failed!!!

A new solution to this old-age problem is the license server, which ensures that no more than the legally allowed number of copies is in use at any one time.Using a license server, any user can install an application and there is no limit to the number of copies of an application an enterprise has. Rather, the number of licenses is the limiting factor .But when a user starts the application, the software connects over the network to the license server and receives a license from the pool of available licenses for that particularapplication. Of course, to run successfully in that environment,the application must be specially written to be license-server

-aware. In other words, it must understand how to connect

Page 34: JINI  –  2002 AND BEYOND …

A License Server (cont.)A License Server (cont.)to the license server and authenticate the user .

The process of license authentication continues until all thelicenses are reserved. When other users attempt to run the application, the license server advises them that they can either purchase more licenses or, ask another user to stopusing the software. When a user exits the application, it releases the reserved license from the license server, allowinganother user to access the application.

Even though license servers have been met with some success, they posses their own unique set of problems.

First, if a user has an application open, it doesn’t mean he isactually uses it. – The reservation however, remains. Second,sometimes a reservation is never returned due to a machinefailure. – The reservation again, remains. Third, making an application license-server-aware requires more work (for the programmer , not his boss). Additionally, if something happens

Page 35: JINI  –  2002 AND BEYOND …

A License Server (cont.)A License Server (cont.)to the license server machine, more change is needed on the client side, and unless the client knows the address of anotherlicense server – he is stuck!

Implementing a license server with Jini, could eliminate some of the problems. In this case, the application will relyon the lease concept. Leases are temporary, and if a clientdoesn’t renew it – he’s out and the license is free (even in the event of power failure, machine crash or leaving for miluim.(

The Jini based license server can represent the licenses withcookies - leased to a client for a limited time.The last type of problems can also benefit from Jini. If a license server is well written, there would be a few licenseservers running simultaneously (connected among them selves).If a license server moves to another location (or even burnsdown), it doesn’t matter, the Jini technology is self-

configuring thus the address isn’t important. A Jini client

Page 36: JINI  –  2002 AND BEYOND …

A License Server (cont.)A License Server (cont.)that looses contact with his license server, couldautomatically search the network for another such service .

A Jini based license server entails changes to applications.But, the outcome is a more robust, efficient and effective

service .

Hurray!!! Jini rules!!!

Page 37: JINI  –  2002 AND BEYOND …

77..Coffee & CakeCoffee & Cake

Available now at the 1st floor, building 30 atCoffeeToGo – special prices for CS students.

ENJOY!!!