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 ...

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.