Advertisment

An Intelligent Web with SunONE

author-image
PCQ Bureau
New Update

Consider this: I have a trip scheduled for Monday from New Delhi to Bangalore, but it has to be postponed to Wednesday. Normally I would have to change my air tickets and my hotel reservation separately. Instead I switch on my Palm Pilot and move the ‘Bangalore trip’ schedule on my calendar from Monday to Wednesday. And voila! My Palm Pilot connects to my airline, cancels my ticket for Monday and gets another issued for Wednesday. Then it connects to the hotel and requests a room for Wednesday instead of Monday. Since, no room is available for Wednesday, it books me in another hotel, for a similar package. Sounds like a sci-fi movie? Well, needn’t be so for long. 

Advertisment

A number of companies have announced initiatives for smart services that are context sensitive– Microsoft’s .NET, HP’s OpenView and SunONE from Sun Microsystems. HP’s OpenView and SunONE are Java based, while .NET focuses on MS technology.

The SunONE (Open Net Environment) was announced on February 5 2001. This new environment promises to unite applications and devices from all ‘Webs’ and make them work in tandem. To understand this concept, let’s look at the Web services that are currently available.

Web services

Advertisment

A Web service is a unit of business that can be accessed from the Web. The user of a Web service can be a

person, an application or a device. A Web service communicates using XML messages.

Six different kinds of Webs can be identified based on who and what is using the Web. 

  • Near Web: Web accessed through a monitor and a keyboard from a desktop.

  • Here Web: It is always with you (typically accessed through a PDA).

  • Far Web: Web accessed through a television (Web top box), used for entertainment.

  • Voice Web: Made possible through recent breakthroughs in voice recognition. For example, your e-mail client reads out your mail.

  • E-commerce Web: Requires very little human intervention. For example, a supply-chain system, where applications can send messages to other applications over the Web.

  • Device Web: For embedded systems. You can message one device from another (switch on your microwave from your cell phone).

Advertisment

Smart services involve communication between these six Webs. For example, the cell phone interacts with the PDA, which connects to an Internet search engine and finds the lowest rates for hotel rooms, makes a reservation, and sends you mail with the details.

Smart services

Smart services can deliver information based on who you are, where you are, and what you are doing. They are context-sensitive services delivered over diverse networks (Webs), simplifying usability and providing value-added services. All of us have some roles and identities, which keep on changing over time. The same person can be an employee, father, friend, and employer, amongst other things at different times of the day. Smart services recognize your roles and behave according to your current role. For example, the same restaurant locator will bring up different options depending on whether you are going to a business dinner or you are with your family. 

Advertisment

The SunONE architecture

SunONE will consist of a number of micro services that will form bigger services called macro services. Micro services will be created using integrated development environments, and code generators. Service assemblers will use business modeling tools and workflow tools to assemble macro services. Assemblers will also use policy tools to define business rules. Macro services will dynamically change their behavior depending on policies. After testing, these services will be deployed in an open directory and be registered.

Service users interact with the services through the service interface. This interface provides basic services like lookup and connection. An example would be a Web portal like Yahoo that provides Web services like e-mail. The service interface directs user requests to appropriate services. Macro and micro services run in service containers. A service container provides runtime environment, persistence and state management services. The service container, in turn, runs on a service platform. The service platform provides access to other resources like databases, external applications and file system.

Advertisment

The service platform resides on the operating system, providing access to hardware, network, etc. The process management service co-ordinates with the service container to manage service workflow and event processing. The service integration works with the service platform to access other Web services and resources.

How different are smart services from Web services?

Smart services behave differently depending on the consumer context. This directly maps to the policies that are applied to the services. These policies are specified by the consumer and are manipulated through a policy engine. Smart services deliver information according to the policies associated with the role, context and identity.

Advertisment

Let’s say you define a policy for your e-mail delivery service, that if you are driving, your mail should be read out from your cellular phone. Or that your refrigerator should send you a weekly list of groceries to be bought. All these rules are specified as part of the policy.

Web-service workflow

A Web service consists of several components that work synchronously. The business logic is embedded in them. Often, these services interact with the outside world using the Web service

interface.

Advertisment

Web services communicate with one other by sending XML messages. These messages are sent by the Web service interface. The XML processor is an integral part of a Web service. The Web service interface is generally implemented as a server side component–a JSP or Java

servlet.

When a Web service needs to send a message to another service, it sends the message to the Web service interface. The interface extracts the context-based information from the client and then creates an XML document containing the message and context information. The context-based information can be extracted using cookies on the client side.

Once this message is received by the service interface of the target service, which may be another JSP/Servlet, the information is extracted from the XML message and a Java object is created out of it. This object is passed to the service component, which contains the business logic. The request is then executed by the service component and a result object is created.

This result object is passed to the service interface, which creates an XML message out of this object. The XML message is then sent back to the service interface which sent the request. Again a Java object is created from this XML message. After creating the Java object, the interface polls the context engine about the current context. The user history files are also parsed for relevant information. The service interface customizes the result based on context information and sends the XML message to the client. Finally, the message is rendered appropriately on the client device.

A real-life scenario

To better understand the above workflow, let’s see what happens when you try to change a hotel reservation from your PDA. The travel-management application on the device, after authentication, will send an XML message to the hotel’s service requesting to change the reservation to a later date. The hotel’s Web service interface receives this request, creates a Java object from this information and passes it to the room-management system. This system contains all the business logic and business objects. After executing the request, a Java object containing the result of the transaction is returned to the hotel’s service interface. This interface will retrieve user history from its database and then customize the result accordingly.

Now an XML message is created from the result object and returned to the travel management application on your PDA. This application will parse the message and display the result.

Amit Jnagal works with IBM. He also runs

the Java users’ group at Gaithersburg, Maryland

Advertisment