Personal Content Space


Traditional database technologies, such as relational databases, provide a robust environment for building corporate systems. However, what is required in the personal portal is a much more agile and flexible information repository. Jini and JavaSpaces, as discussed in Chapter 14, "Jini and JavaSpaces," and Chapter 15, "P2P Jini and JavaSpaces," provide an alternative to meet the requirements of your personal content space.

With JavaSpaces, distributed processes communicate by reading and writing entries into a space. A space is defined by JavaSpaces as a shared network-accessible repository for objects. This shared repository can persist objects written to a space beyond the lifetime of the process that created them. Spaces provide reliable storage for objects, and support the concept of leasing. The JavaSpace API provides an event notification mechanism, which enables processes to register for notification when a specific object is written to space. This can be a powerful mechanism to activate and automate content-related tasks.

Objects in a space are located via associative lookup, as opposed to more traditional keys or identifiers. When you read or take an object from a space, a local copy of the object is created. As with any other local object, you can modify its public fields and invoke its methods.

Recall the JavaSpace API from Chapter 15 (shown again in Listing 18.1).

Listing 18.1 JavaSpace API Interface
 package net.jini.space; import java.rmi.*; import net.jini.core.event.*; import net.jini.core.transaction.*; import net.jini.core.lease.*; public interface JavaSpace {     public final long NO_WAIT = 0; // don't wait at all     Lease write(Entry e, Transaction txn, long lease)         throws RemoteException, TransactionException;     Entry read(Entry tmpl, Transaction txn, long timeout)         throws TransactionException, UnusableEntryException,                RemoteException, InterruptedException;     Entry readIfExists(Entry tmpl, Transaction txn,                        long timeout)         throws TransactionException, UnusableEntryException,                RemoteException, InterruptedException;     Entry take(Entry tmpl, Transaction txn, long timeout)         throws TransactionException, UnusableEntryException,                RemoteException, InterruptedException;     Entry takeIfExists(Entry tmpl, Transaction txn,                        long timeout)         throws TransactionException, UnusableEntryException,                RemoteException, InterruptedException;     EventRegistration notify(Entry tmpl, Transaction txn,               RemoteEventListener listener, long lease,               MarshalledObject handback)         throws RemoteException, TransactionException;     Entry snapshot(Entry e) throws RemoteException; } 

The space interface consists of only seven methods. JavaSpaces simplifies the process of building and managing distributed applications. This will be an important property for building future personal applications that extend your portals capabilities. Because it is based on Jini, it has some immediate network benefits. JavaSpaces can provide a notification platform capable of informing services and individuals of changes in information content. In effect, it can become the central nervous system of your content environment. Management of the service is minimized, and the self-healing properties of a Jini network can be leveraged to provide constant communication over less-than-reliable communication networks.

Peer-to-peer systems have already demonstrated the need for a distributed network of loosely coupled collaborating processes. These processes require identity, task management, and coordination. JavaSpaces provides a lightweight implementation of persistence that can aid in implementing a collective memory a collective memory that is actually applicable not only in a business environment, but in the home of the future.

JavaSpaces is built on object database technology. Object databases are known for being extremely flexible in content storage capabilities and in the level of granularity that they support. Object technology is at the heart of Java, so it makes sense that an object database or a personal object repository should be implemented using object-based technology.

The personal portal envisioned is not a static entity only capable of serving Web pages. Rather, it is an active member of the global P2P network space. It is able to discover services, such as banking, investment, and entertainment, and integrate those services into its knowledge of the outside world.



JavaT P2P Unleashed
JavaT P2P Unleashed
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 209

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net