JXTA

net.jxta.peergroup
Class PeerGroupFactory

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

Deprecated. This factory has been deprecated in favour of WorldPeerGroupFactory and NetPeerGroupFactory. See the deprecations for the individual methods for the specific replacements/alternatives provided by the new factory classes.

@Deprecated
public final class PeerGroupFactory
extends Object

A factory for instantiating the JXTA core peer groups.

JXTA comes with two peergroup implementations:

Platform
Implements the world peer group. Every peer starts by instantiating this peer group and then other peer groups are instantiated as needed. The World Peer Group's ID is invariant.

The world peer group provides the minimum core services needed to find and instantiate other groups on a peer. The Platform implementation will assign a new ID to the peer, if it does not already have one.

StdPeergroup
This is currently used to implement all other kinds of peer groups. The first such peer group that it is instantiated after starting is known as The Net Peer Group. When the Platform starts it may optionally search for The Net Peer Group on the local network and, if found, instantiate it. Otherwise a default built-in configuration of The Net Peer Group is instantiated.

A non-default configuration of The Net Peer Group may be set-up by the administrator in charge of the network domain inside which the peer is starting. The Net Peer Group is discovered via the Discovery protocol. Many such groups may be configured by an administrator.

StdPeergroup may also be used to implement User-defined peer groups--Users can create new peer groups which use their own set of customized services.

See Also:
PeerGroup

Field Summary
static Class DEFAULT_CONFIGURATOR
          Deprecated. Constant for specifying the default configurator.
static Class NULL_CONFIGURATOR
          Deprecated. Constant for specifying no configurator.
 
Constructor Summary
PeerGroupFactory()
          Deprecated.  
 
Method Summary
static Class getConfiguratorClass()
          Deprecated. Consider converting to use NetPeerGroupFactory.
static URI getStoreHome()
          Deprecated. Consider converting to use NetPeerGroupFactory and/or WorldPeerGroupFactory.
static PeerGroup newNetPeerGroup()
          Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory() or preferably one of the other NetPeerGroupFactory constructors.
static PeerGroup newNetPeerGroup(PeerGroup ppg)
          Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory(PeerGroup,ID,String,XMLElement).
static PeerGroup newPeerGroup()
          Deprecated. This method was previously unused and has been removed with no alternatives. (it wasn't useful)
static PeerGroup newPlatform()
          Deprecated. Consider converting to use WorldPeerGroupFactory.WorldPeerGroupFactory().
static void setConfiguratorClass(Class c)
          Deprecated. Consider converting to use NetPeerGroupFactory and/or WorldPeerGroupFactory.
static void setNetPGDesc(String desc)
          Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory(ConfigParams,URI,ID,String,XMLElement) or NetPeerGroupFactory.NetPeerGroupFactory(PeerGroup,ID,String,XMLElement).
static void setNetPGID(PeerGroupID id)
          Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory(ConfigParams,URI,ID,String,XMLElement) or NetPeerGroupFactory.NetPeerGroupFactory(PeerGroup,ID,String,XMLElement).
static void setNetPGName(String name)
          Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory(ConfigParams,URI,ID,String,XMLElement) or NetPeerGroupFactory.NetPeerGroupFactory(PeerGroup,ID,String,XMLElement).
static void setPlatformClass(Class c)
          Deprecated. Consider converting to use WorldPeerGroupFactory.WorldPeerGroupFactory(Class,ConfigParams,URI).
static void setStdPeerGroupClass(Class c)
          Deprecated. This method previously had no effect and has been removed with no alternatives.
static void setStoreHome(URI newHome)
          Deprecated. Consider converting to use NetPeerGroupFactory and/or WorldPeerGroupFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_CONFIGURATOR

public static final Class NULL_CONFIGURATOR
Deprecated. 
Constant for specifying no configurator. This configurator provides no configuration actions but does ensure that a valid configuration exists at the specified location.


DEFAULT_CONFIGURATOR

public static final Class DEFAULT_CONFIGURATOR
Deprecated. 
Constant for specifying the default configurator. Currently this is the familiar AWT-based dialogue but in future is likely to become the UI-less automatic configurator.

Constructor Detail

PeerGroupFactory

public PeerGroupFactory()
Deprecated. 
Method Detail

setPlatformClass

@Deprecated
public static void setPlatformClass(Class c)
Deprecated. Consider converting to use WorldPeerGroupFactory.WorldPeerGroupFactory(Class,ConfigParams,URI).

Static Method to initialize the world peer group class.

Parameters:
c - The Class which will be instantiated for the World Peer Group

setStdPeerGroupClass

@Deprecated
public static void setStdPeerGroupClass(Class c)
Deprecated. This method previously had no effect and has been removed with no alternatives.

Static Method to initialize the std peer group class.

Parameters:
c - The Class which will be instantiated for most peer groups.

setNetPGDesc

@Deprecated
public static void setNetPGDesc(String desc)
Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory(ConfigParams,URI,ID,String,XMLElement) or NetPeerGroupFactory.NetPeerGroupFactory(PeerGroup,ID,String,XMLElement).

Sets the description which will be used for new net peer group instances.

Parameters:
desc - The description which will be used for new net peer group instances.

setNetPGName

@Deprecated
public static void setNetPGName(String name)
Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory(ConfigParams,URI,ID,String,XMLElement) or NetPeerGroupFactory.NetPeerGroupFactory(PeerGroup,ID,String,XMLElement).

Sets the name which will be used for new net peer group instances.

Parameters:
name - The name which will be used for new net peer group instances.

setNetPGID

@Deprecated
public static void setNetPGID(PeerGroupID id)
Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory(ConfigParams,URI,ID,String,XMLElement) or NetPeerGroupFactory.NetPeerGroupFactory(PeerGroup,ID,String,XMLElement).

Sets the ID which will be used for new net peer group instances.

Parameters:
id - The ID which will be used for new net peer group instances.

getConfiguratorClass

@Deprecated
public static Class getConfiguratorClass()
Deprecated. Consider converting to use NetPeerGroupFactory.

Get the optional configurator class for the world peer group.

Returns:
Class configurator class

setConfiguratorClass

@Deprecated
public static void setConfiguratorClass(Class c)
Deprecated. Consider converting to use NetPeerGroupFactory and/or WorldPeerGroupFactory.

Set the optional configurator class for the World Peer Group. If present an instance of this class will be used to generate/update the configuration parameters for the World Peer Group whenever newPlatform() is invoked.

All configuration actions for the World Peer Group may be completely disabled by specify null as the configurator class. The default configuration class is always initialized to DEFAULT_CONFIGURATOR.

Parameters:
c - The Class to use as a configurator for the World Peer Group.

getStoreHome

@Deprecated
public static URI getStoreHome()
Deprecated. Consider converting to use NetPeerGroupFactory and/or WorldPeerGroupFactory.

Returns the location which will serve as the parent for all stored items used by JXTA. This method is intended for use by PeerGroup implementations and is not intended for use by applications. Applications and services should use the PeerGroup method with the same name.

Returns:
The location which will serve as the parent for all stored items used by JXTA.
See Also:
PeerGroup.getStoreHome()

setStoreHome

@Deprecated
public static void setStoreHome(URI newHome)
Deprecated. Consider converting to use NetPeerGroupFactory and/or WorldPeerGroupFactory.

Set the location which will serve as the parent for all stored items used by JXTA.

Parameters:
newHome - The absolute URI location which will serve as the parent for all stored items used by JXTA. Currently this must be a non-opaque URI. May also be null to restore the default value.

newPeerGroup

@Deprecated
public static PeerGroup newPeerGroup()
Deprecated. This method was previously unused and has been removed with no alternatives. (it wasn't useful)

Static Method to create a new peer group instance.

After being created the init() method needs to be called, and the startApp() method may be called, at the invoker's discretion.

Returns:
PeerGroup instance of a new PeerGroup

newPlatform

@Deprecated
public static PeerGroup newPlatform()
Deprecated. Consider converting to use WorldPeerGroupFactory.WorldPeerGroupFactory().

Instantiates the World (Platform) Peer Group and can also optionally (re)configure the world peer group before instantiation using the configurator specified via setConfiguratorClass(Class).

Only one instance of the World Peer Group may be created within the context of the PeerGroupFactory's class loader. Invoking this method amounts to creating an instance of JXTA.

The Module.init(PeerGroup,ID,Advertisement) method is called automatically. The Module.startApp(String[]) method is left for the invoker to call if appropriate.

Returns:
PeerGroup The World Peer Group instance.
Throws:
JxtaError - Thrown for all checked Exceptions which occur during construction of the World Peer Group.

newNetPeerGroup

@Deprecated
public static PeerGroup newNetPeerGroup(PeerGroup ppg)
                                 throws PeerGroupException
Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory(PeerGroup,ID,String,XMLElement).

Instantiates the net peer group using the provided parent peer group.

Parameters:
ppg - The parent group.
Returns:
PeerGroup The default netPeerGroup
Throws:
PeerGroupException - For failures in constructing the Net Peer Group.

newNetPeerGroup

@Deprecated
public static PeerGroup newNetPeerGroup()
                                 throws PeerGroupException
Deprecated. Consider converting to use NetPeerGroupFactory.NetPeerGroupFactory() or preferably one of the other NetPeerGroupFactory constructors.

Instantiates the World Peer Group and then instantiates the Net Peer Group. This simplifies the method by which applications can start JXTA.

Returns:
The newly instantiated Net Peer Group.
Throws:
PeerGroupException

JXSE