net.jxta.peergroup
Class PeerGroupFactory
java.lang.Object
|
+--net.jxta.peergroup.PeerGroupFactory
- public class PeerGroupFactory
- extends java.lang.Object
Factory Classes to create a new Peer Platform and New PeerGroups. This
class is used by Jxta applications to create new groups
JXTA comes with two subclasses of peer groups:
- Platform: this is used to represent the World
group. Every peer, when booting, becomes part of this group. This group
provides the minimum core services needed to find and instanciate other
groups on a peer. Platform has the privilege of assigning
a new ID to the peer, if it does not already have one. The World
group's ID is invariant.
- StdPeergroup: this is currently used to implement
all other kinds of peer groups.
The first such group that it is instanciated after booting is known as
The Net Peer Group. When Platform starts it may
optionaly search for The Net Peer Group on the local network and,
if found, instanciate it. Otherwise a default configuration of
The Net Peer Group is instanciated.
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 booting. The Net Peer Group is discovered via the DiscoveryService
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.
The Platform group is created via the newPlatform method. The Net
Peer Group and user Peer Groups are created via the newPeerGroup
method.
- Since:
- JXTA 1.0
- Version:
- $Revision: 1.30 $
- See Also:
PeerGroup
|
Method Summary |
static PeerGroup |
newNetPeerGroup()
Creates a default platform peergroup, from which a new netpeergroug is
created. |
static PeerGroup |
newNetPeerGroup(PeerGroup pg)
Until the concept of netPeerGroup is better integrated, we need
something straightforward so that applications that whish to control
the start-up process can easily bring up a netPeerGroup like
startNetPeerGroup does. |
static PeerGroup |
newPeerGroup()
Static Method to create a new peer group instance. |
static PeerGroup |
newPlatform()
Static Method to create a new peer Plaform
The init() method is called automatically. |
static void |
setPlatformClass(java.lang.Class c)
Static Method to initialize the Platform peergroup class |
static void |
setStdPeerGroupClass(java.lang.Class c)
Static Method to initialize the std peer group class |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
setStdPeerGroupClass
public static void setStdPeerGroupClass(java.lang.Class c)
- Static Method to initialize the std peer group class
- Parameters:
Class - name to be initialized in the factory- Since:
- JXTA 1.0
setPlatformClass
public static void setPlatformClass(java.lang.Class c)
- Static Method to initialize the Platform peergroup class
- Parameters:
Class - name of the class implementing platform- Since:
- JXTA 1.0
newPeerGroup
public static PeerGroup newPeerGroup()
- Static Method to create a new peer group instance.
After beeing 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
public static PeerGroup newPlatform()
- Static Method to create a new peer Plaform
The init() method is called automatically. The startApp() method
is left for the invoker to call if appropriate.
Invoking this method amounts to creating an instance of JXTA.
Since JXTA stores its persistent state in the local filesystem
relative to the initial current directory, it is unadvisable to
start more than one instance with the same current directory.
- Returns:
- PeerGroup instance of a new Platform
- Since:
- JXTA 1.0
newNetPeerGroup
public static PeerGroup newNetPeerGroup(PeerGroup pg)
throws PeerGroupException
- Until the concept of netPeerGroup is better integrated, we need
something straightforward so that applications that whish to control
the start-up process can easily bring up a netPeerGroup like
startNetPeerGroup does.
This method does this.
- Parameters:
pg - The platform group.- Returns:
- PeerGroup The default netPeerGroup
newNetPeerGroup
public static PeerGroup newNetPeerGroup()
throws PeerGroupException
- Creates a default platform peergroup, from which a new netpeergroug is
created. This simplifies the method by which applications can start jxta.
- Returns:
- The newly created net peer group.