ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

Jini and JavaSpaces: the B2B Dark Horse?
Pages: 1, 2

Leasing and the need for self healing networks in B2B

If you've integrated systems across a network, you know that the resiliency of the network and the ability to cope with network failures separates good applications from primitive ones. Jini assumes at its foundation that the network may be unstable.



Jini introduces the idea of a lease to service management. If you are a user of a service, you never own the service, you simply lease it. Nothing is permanent. All resources must have some management process that periodically checks to see if everything is okay and to determine whether the resource is still required by the user.

Imagine I am a service provider publishing services offered to B2B exchanges. My system crashes, or I am having system problems. How does the exchange maintain my status in a timely fashion? There's not likely to be a consistent approach across exchanges.

Leasing is an important part of Jini infrastructure robustness. Leasing allows the lookup service to delete services that have failed to renew their lease. If you provide a service, or if you are using a service, you must periodically renew your lease. The renewal period depends on the application. You request a finite renewal period on your lease, and the service provider determines the actual lease commitment. It's analogous to apartment leasing. I ask the apartment complex for a 6-month lease. They inform me they can only commit to 1-month lease periods. After 1 month I must renew my lease, or I am evicted.

When you use the Web you often find nvalid URL references or slow sites. B2B e-commerce is being built on this same infrastructure and architecture. System and network instability will be an issue. B2B E-Commerce will require the self-healing properties of a Jini network.

Distributed transactions

Transactions are at the core of B2B e-commerce. The exchange of goods and services involves monetary transactions. Transactions and transactional integrity are not new issues in distributed computing. However, traditional solutions have tended to be heavyweight and complex. As we expand our notion of distributed transactions to include a broader array of cliens like cell phones, palm pilots, and mobile agents, we will require support for more flexible and lightweight transactions.

Jini uses the traditional two-phase commit transaction protocol, which attempts to ensure the well-known ACID properties to data manipulations. Database management systems go to great lengths to ensure data integrity. As a result system overhead is generally proportional to the degree of transactional integrity. More system resources are required to ensure data integrity in the light of failures that may occure in reading, writing, and updating it.

Jini provides only the interface to transactions, and it closely resembles the two-phase commit protocol. Jini also comes packaged with an example Transaction service, mahalo, that's used with the JavaSpaces service (See below). By providing only an object interface to transactions, Jini does not dictate implementation. The notion of data consistency with regard to partial failure is promoted through the two-phase commit based interface. But the key is the degree to which the implementation will try to ensure consistency despite a partial or catastrophic failure.

Lightweight implementations will reduce the overhead and time required to deploy transactional systems. Similar to message oriented middleware (MOM), which provides various levels of message assurance, the new breed of transactional systems will provide various levels of transactional integrity.

In B2B exchanges the degree of transactional integrity will be dependent on the application context. B2B supply chain integration requires the coordination of multiple trading partner processes. Workflow is one area where transactional coordination of processes may be satisfied by a lighter weight implementation.

Workflow Automation and Integration

JavaSpaces is an example service that runs on the Jini network. JavaSpaces is closely tied to the Jini architecture. In fact it is one of the few services bundled with Jini. JavaSpaces was heavily influenced by the tuple spaces, which were first described in 1982 in the Linda language. The basic idea is that you can have many active programs distributed over physically dispersed machines, unaware of each other's existence, able to communicate by releasing tuples into the shared tuple space. Programs read, write, and take tuples from the tuple space that are of interest to them.

The B2B e-commerce environment has many of the attributes just described. For instance the environment is composed of distributed cooperating systems able to communicate by exchanging business information. The requirement to locate trading partners dynamically provides an even closer comparison.

To be successful in B2B e-commerce you must be able to integrate business transactions into your workflow processes and backend systems. Business-to-consumer (B2C) offerings have demonstrated the need for end-to-end service and fulfillment. Failure to support products and processes across channels diminishes your chances for success.

Integrating workflow and legacy systems has always been a complex and costly undertaking. JavaSpaces provides a simplified approach to dynamic communication, coordination, and sharing of objects between network resources. JavaSpaces acts as a virtual space between providers and requesters of network services. This allows participants in a distributed solution to exchange tasks, requests, and information in the form of Java objects.

Jini in concert with JavaSpaces provides a mechanism to loosely couple systems through remote events and a persistent shared memory model. Processes can exchange information through this space and be notified of changes through asynchronous events. JavaSpaces supports two implementation models: transient and persistent spaces. Transient spaces do not survive across a system restart, while persistent spaces use secondary storage to save restore services upon activation. The simplicity of the JavaSpaces API provides an easy interface, yet it still provides a powerful programming model.

As we move toward B2B service and component-based architectures, coordination and automation of processes both internal and external will take on more importance. Generic workflow engines supporting standard APIs will help integrate both internal and external processes. Jini and JavaSpaces are a network-centric middleware solution for enabling next generation communication and collaboration.

Agents of collaboration

Let's end our discussion of the B2B dark horse contender, Jini and JavaSpaces, by discussing it as a platform for agents of collaboration. We thus move beyond traditional two-tier environments to discuss the opportunities emerging with P2P.

Software agents conjure up images of sci-fi technology. But the popularity of the Internet has ushered in a new era of communication and collaboration. Autonomous agents will provide a strategic advantage in the acquisition and control of information.

Autonomous agents are often defined as systems capable of acting on behalf of a user by learning and cooperating with their environment. Typically there's an agenda or goal that drives an agent's behavior. A mobile agent is able to move across machines and networks to carry out this mission. There's lots of of work being done to provide mobile agents for network management. It is easy to envision the benefits gained by network managers using mobile agents to relay conditions and instructions to network elements.

Jini provides a foundation for many of the requirements of mobile agents. As mentioned above, the ability to move code from machine to machine, through downloadable proxies, is one of the key enablers of the Jini framework. Business-to-business e-commerce can also benefit from agent technologies and specifically Jini-based implementations.

Often we think of B2B and B2C as two separate models of participation and communication. But B2B and B2C are not discreet models but rather exist on a continuum. By introducing agents you add another element of complexity to your current processing capabilities. As a result the ability to leverage software agents at key points -- in distribution, manufacturing, sales, and customer relationship management -- becomes compelling.

B2B and B2C are not discreet models but rather exist
on a continuum.

Figure 5. , B2B and B2C are not discreet models but rather exist on a continuum.

Imagine a business engaged in distributing products and services over the Web. Detailed market research is involved in determining the effectiveness of this distribution channel. Many companies are looking for more effective data capture and analysis techniques. A trellis pattern is one possible solution.

A trellis consists of a hierarchical group of processes. These processes can range from low-level data capture to high-level production forecasting. Jinni and JavaSpaces can be used to build trellis patterns. These patterns combine traditional systems, agents, and information workers, coordinating and collaborating at different levels within the process hierarchy.

The Jini network of loosely-coupled collaborating processes is an ideal foundation for the acquisition and control of information. Cutting edge corporations are investing in technologies to help systems and information workers become more effective in the capture, analysis, and dissemination of information.

Jini and JavaSpaces offer great promise in allowing systems, agents, and information workers to collaborate in new and exciting ways. These technologies will enable multi-dimensional information exchange and intuitive work group formation.

Betting on the dark horse may be your best bet.

Robert Flenner is an active author, software developer, and independent contractor who is actively involved with emerging B2B technologies.


Return to ONJava.com.