O'Reilly logo

JXTA in a Nutshell by Li Gong, Bernard Traversat, Scott Oaks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. A Hello World Example

In the next few chapters, we’ll show you how to write JXTA applications using the Java language API provided with the JXTA platform. If you want to use a different language, the program structure that we describe will be helpful, though the syntax and API calls will be different. The JXTA API is used by application and service developers: it provides high-level constructs, such as pipes and peergroups, for application developers, as well as low-level constructs, such as advertisements and structured documents, for service developers. The examples in the next few chapters cover both types of constructs.

We’ll start in this chapter with a simple “Hello world” example. This example will cover the basic flow of control for a JXTA application and how a JXTA application is configured and executed. In later chapters, we’ll use a restaurant auction example to illustrate other key concepts, such as discovery, peergroups, pipes, advertisements, services, and security.

The JXTA platform provides an integrated environment to run applications. An application can be run in three ways:

  • An application can be added to the JXTA Shell, after which it may be run interactively in an instance of the shell.

  • A standalone application can be written to instantiate, configure, and use the JXTA platform.

  • A JXTA service can be used by other JXTA applications. JXTA services can be started on demand.

In the next three chapters, we’ll focus on the second method. This method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required