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

Name

PeerGroup

Synopsis

Instances of this class represent the core JXTA peergroup service. The peergroup service forms the basis of a number of JXTA operations that every peer must undertake.

JXTA peers typically join the NetPeerGroup by calling the newNetPeerGroup( ) method of the PeerGroupFactory class, which returns a peergroup object. Alternately, they may use the newPeerGroup( ) method of the PeerGroupFactory to join the NetPeerGroup, which also returns a peergroup object. In either case, the returned object is used to locate the core JXTA services: discovery, membership, and so on. In general, peers are encouraged to use the discovery service of the NetPeerGroup to locate other peergroups and use the services of the other peergroups to communicate with other peers. This prevents the NetPeerGroup from being overwhelmed.

New peergroups are created by the newGroup( ) method of this interface. You must have a new peergroup advertisement in order to make a new peergroup. This is usually accomplished by discovering the peergroup advertisement that you’re interested in: you retrieve the discovery service from a peergroup (using the getDiscoveryService( ) method) and use it to find the peergroup advertisement. If no advertisement is found, you must create one; the easiest way to do this is to use the advertisement returned from the getAllPurposePeerGroupImplAdvertisement( ) method of this interface. This advertisement may be modified to provide for new services within the new ...

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