Project JXTA

net.jxta.peergroup
Class PeerGroup.GlobalRegistry

java.lang.Object
  extended bynet.jxta.peergroup.PeerGroup.GlobalRegistry
Enclosing class:
PeerGroup

public static class PeerGroup.GlobalRegistry
extends Object


Constructor Summary
PeerGroup.GlobalRegistry()
           
 
Method Summary
 PeerGroup lookupInstance(PeerGroupID gid)
          Returns a running instance of the peergroup with given ID if any exists.
 boolean registerInstance(PeerGroupID gid, PeerGroup pg)
          Registers a new instance.
 boolean unRegisterInstance(PeerGroupID gid, PeerGroup pg)
          Unregisters a group instance (normaly because the group is being stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeerGroup.GlobalRegistry

public PeerGroup.GlobalRegistry()
Method Detail

registerInstance

public boolean registerInstance(PeerGroupID gid,
                                PeerGroup pg)
Registers a new instance.

Parameters:
gid - the ID of the group of which an instance is being registered.
pg - the group instance being registered.
Returns:
false if the instance could not be registered because there was already such an instance registered.

unRegisterInstance

public boolean unRegisterInstance(PeerGroupID gid,
                                  PeerGroup pg)
Unregisters a group instance (normaly because the group is being stopped.

Parameters:
gid - the ID of the group of which an instance is unregistered.
pg - the group instance itself (serves as a creadential).
Returns:
false if the group could not be unregistered because no such registration (exact ID, exact object) was not found.

lookupInstance

public PeerGroup lookupInstance(PeerGroupID gid)
Returns a running instance of the peergroup with given ID if any exists.

Parameters:
gid - the id of the group of which an instance is wanted.
Returns:
the group, or null if no instance exists.

JXTA J2SE