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

A Peergroup Service Example

Peergroup services are advertised as part of the peergroup advertisement. Therefore, its service is published when its peergroup advertisement is published. Each member of the peergroup has access to the peergroup advertisement and will typically instantiate each peergroup service.

An implementation of a peergroup may define its own policy to determine how peergroup services are instantiated. The v1.0 platform automatically instantiates every peergroup service listed in the peergroup advertisement. However, this is only one possible policy. Other implementations may use different policies, such as loading on-demand (i.e., instantiating a service only if somebody is trying to use it), or letting the peer decide which peergroup services to instantiate. The latter policy is useful when a memory-constrained device tries to join a peergroup. Since the device may not have enough memory to run all peergroup services, it can instead run only the necissary services.

Publishing a service as part of the peergroup advertisement means that every member of the peergroup knows about the service without any further discovery: there is no need to discover the service since the service advertisement is present in the peergroup advertisement. When the peergroup advertisement is found, the peer can extract all of the necessary information about a desired service from the peergroup advertisement. Peer services, on the other hand, require two discovery requests: one ...

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