JXTA

net.jxta.peergroup
Class WorldPeerGroupFactory

java.lang.Object
  extended by net.jxta.peergroup.WorldPeerGroupFactory

public final class WorldPeerGroupFactory
extends Object

A factory for instantiating the World Peer Group. Every peer starts by instantiating the World Peer Group and then other Peer Groups are instantiated as needed. Most applications do not need to use WorldPeerGroupFactory but should instead prefer using NetPeerGroupFactory whenever possible.

The World Peer Group provides the minimum core services needed to find and instantiate other Peer Groups on a peer. The World Peer Group is the primordial peer group upon which all other peer groups are instantiated. The World Peer Group is primarily responsible for management of physical network connections, physical network discovery (generally broadcast) and physical network topology management.

Applications generally do not normally interact directly with the World Peer Group. The World Peer Group includes only limited endpoint, resolver, discovery and rendezvous services.

When the World Peer Group starts it may optionally search for The Network Peer Group on the local network and, if found, instantiate it. Otherwise a default built-in configuration of The Net Peer Group is instantiated.

Since:
JXTA JSE 2.4
See Also:
PeerGroup, NetPeerGroupFactory

Constructor Summary
WorldPeerGroupFactory()
          Provided for backwards compatibility, this constructor instantiates the World Peer Group using the PlatformConfig file found in the directory specified by the JXTA_HOME system property or the ".jxta/" directory if JXTA_HOME is not defined.
WorldPeerGroupFactory(Class worldPeerGroupClass, ConfigParams config, URI storeHome)
          Constructs the World Peer Group using the specified configuration and using the specified storeHome location for persistence.
WorldPeerGroupFactory(ConfigParams config, URI storeHome)
          Constructs the World Peer Group using the specified configuration and using the specified storeHome location for persistence.
 
Method Summary
 PeerGroup getInterface()
          Returns a strong (reference counted) interface object for the World Peer Group.
 PeerGroup getWeakInterface()
          Returns a weak (non-reference counted) interface object for the World Peer Group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorldPeerGroupFactory

public WorldPeerGroupFactory()
                      throws PeerGroupException
Provided for backwards compatibility, this constructor instantiates the World Peer Group using the PlatformConfig file found in the directory specified by the JXTA_HOME system property or the ".jxta/" directory if JXTA_HOME is not defined.

Though not deprecated this method should be considered as sample code only and the other constructors should be used whenever possible.

Throws:
PeerGroupException - Thrown for problems construction the World Peer Group.

WorldPeerGroupFactory

public WorldPeerGroupFactory(ConfigParams config,
                             URI storeHome)
                      throws PeerGroupException
Constructs the World Peer Group using the specified configuration and using the specified storeHome location for persistence.

Parameters:
config - The configuration to use for the World Peer Group.
storeHome - The optional location that the World Peer Group and its' services should use for storing persistent and transient information. May be null if the World Peer Group is not provided a persistent store (though this not currently supported).
Throws:
PeerGroupException - Thrown for problems constructing the World Peer Group.

WorldPeerGroupFactory

public WorldPeerGroupFactory(Class worldPeerGroupClass,
                             ConfigParams config,
                             URI storeHome)
                      throws PeerGroupException
Constructs the World Peer Group using the specified configuration and using the specified storeHome location for persistence.

Parameters:
worldPeerGroupClass - The class which will be instantiated for the World Peer Group instance.
config - The configuration to use for the World Peer Group.
storeHome - The optional location that the World Peer Group and its' services should use for storing persistent and transient information. May be null if the World Peer Group is not provided a persistent store (though this not currently supported).
Throws:
PeerGroupException - Thrown for problems constructing the World Peer Group.
Method Detail

getInterface

public PeerGroup getInterface()
Returns a strong (reference counted) interface object for the World Peer Group. This reference should be explicitly unreferenced when it is no longer needed.

Returns:
A strong (reference counted) interface object for the World Peer Group.
See Also:
PeerGroup.unref()

getWeakInterface

public PeerGroup getWeakInterface()
Returns a weak (non-reference counted) interface object for the World Peer Group.

Returns:
A weak (non-reference counted) interface object for the World Peer Group.
See Also:
PeerGroup.getWeakInterface()

JXSE