Home > Articles

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Starting JXTA

Before we can start talking about any specific Java API for the JXTA protocols, you need to start JXTA. JXTA applications begin by joining the Net peer group. The Net group provides your default behavior and starts the JXTA services.

The following line of code is the usual way you start JXTA. The PeerGroupFactory is used to create a Net peer group. The Net group is a special group that is meant to be defaut or defined by a system administrator:

PeerGroup netPeerGroup = PeerGroupFactory.newNetPeerGroup();

The variable netPeerGroup in this line represents a layering of two groups, the World group and the Net group. The services available are in the Net group but are mostly passed on to the World group. For example, if you use discovery services, the World peer group is used and all peers will be available.

  • + Share This
  • 🔖 Save To Your Account