Chapter 1. Introduction to JXTA

You’re driving home at night; it’s late and you’re hungry. Imagine that your car has a device that automatically locates nearby restaurants and tells you which of them has the food you want at the best price. Better yet — what if you could contact nearby drivers, see if any of them also want to stop for food, and spontaneously form a group that negotiates with a nearby restaurant for a volume discount?

While you’re waiting in the restaurant, you run into an old business acquaintance; in a brief discussion, you realize that she is working on a project that could provide a key feature for your own work. You could exchange business cards with her, of course, but why not immediately exchange the specifications of your projects instead?

And speaking of your office: you’ve still got to stop by the new print shop and pick up the slides for tomorrow’s meeting. What if your desktop computer could find a new print shop that provides full color transparency printing services in just one hour?

These types of services have long been envisioned in an increasingly mobile and “connected” population. To a certain extent, many of them are possible today, especially if you have access to a centralized server or the other participants. JXTA will help us to expand such applications.

What Is JXTA?

JXTA is a collaborative research project for peer-to-peer (P2P) computing. “Project JXTA” (or, more simply, JXTA) stands for Project Juxtapose; it is an acknowledgment that while client/server and web-based computing are important standards today, a strong need exists for P2P computing standards for a variety of applications. These applications share a few common traits.

  • They are spontaneous in nature.

  • They are more effective when the supporting architecture involves many distributed providers of the service rather than a single, centralized server.

  • Users of the application may be providers or consumers of the service abstracted by the application; they often perform both roles.

  • Users of the application come and go and therefore may not be available at any particular point in time.

  • Users of the application may be using any device at any time in any location.

Applications with these requirements are difficult to implement with traditional client/server computing models; they run better from a collection of cooperating peers with the ability to discover each other independently and to communicate regardless of the network infrastructure on which they reside.

To that end, JXTA defines a small set of common protocols that enable P2P computing. Each protocol is simple to implement and integrate into existing systems. This set of protocols defines JXTA.

It’s important to realize the ramifications of that last statement. In particular, JXTA is not an API; although there are standard language bindings for the JXTA protocols, their use is not mandatory. Application developers and hardware providers may provide their own language bindings. New languages can evolve and provide their own bindings to the JXTA protocols, and new platforms can be developed that implement the JXTA protocols in entirely new ways. JXTA is language- and platform-independent.

Furthermore, JXTA is network-independent: the JXTA protocols can be transmitted over TCP/IP, HTTP, Bluetooth, home networks such as Home-PNA, and so on. Peers located on different networks can easily communicate using the standard JXTA protocols.

Hence, JXTA is a set of language- and network-independent protocols that enable the deployment of applications and services among continually changing groups of cooperating computing devices.

jxta.org

JXTA is an open source project; it is overseen by Sun Microsystems (which submitted much of its initial specifications and technology), but has been developed by contributors throughout the world.

All work on JXTA is organized through the JXTA web site: http://www.jxta.org/. You can download specifications, API libraries, and sample code from there; more importantly, you can sign up on this site to become a JXTA contributor. Contributors to JXTA can work on the JXTA specifications, the language bindings, or any number of collaborative JXTA applications. Also, Sun and other industry groups sponsor JXTA developer conferences.

All code developed under Project JXTA (including code originally submitted by Sun) is subject to the Sun Project JXTA Software License, which is available at http://www.jxta.org/project/www/license.html. This license is based on the Apache Software License Version 1.1 and is substantially different from other licenses under which Sun issues Java technology. The Project JXTA Software License allows all JXTA code to be redistributed in both source and binary form, provided that certain copyright and other acknowledgments appear in the redistribution.

Note that the JXTA license allows liberal use of JXTA technology but does not require that all code using JXTA adopt the JXTA license. Proprietary code can use JXTA code (provided it supplies the appropriate copyright notice) without a fee and remain proprietary.

For more information, see the licensing FAQ at http://www.jxta.org/project/www/docs/DomainFAQ.html#licmodel.

Get JXTA in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.