Project JXTA

net.jxta.impl.peergroup
Class ShadowPeerGroup

java.lang.Object
  extended by net.jxta.impl.peergroup.GenericPeerGroup
      extended by net.jxta.impl.peergroup.StdPeerGroup
          extended by net.jxta.impl.peergroup.ShadowPeerGroup
All Implemented Interfaces:
CompatibilityEquater, PeerGroup, Module, Service

public class ShadowPeerGroup
extends StdPeerGroup

ShadowPeerGroup is almost a regular StdPeerGroup, except that it borrows its parent's configuration. The only real use is for the netPeerGroup


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.jxta.peergroup.PeerGroup
PeerGroup.GlobalRegistry
 
Field Summary
 
Fields inherited from class net.jxta.impl.peergroup.StdPeerGroup
compatKey1, compatKey2, compatVal1, compatVal2, disabledModules, stdCompatStatement, stdProvider, stdUri
 
Fields inherited from class net.jxta.impl.peergroup.GenericPeerGroup
configAdvertisement, configurator, parentGroup
 
Fields inherited from interface net.jxta.peergroup.PeerGroup
accessClassID, allPurposePeerGroupSpecID, applicationClassID, Both, DEFAULT_EXPIRATION, DEFAULT_LIFETIME, discoveryClassID, endpointClassID, FromParent, globalRegistry, Here, httpProtoClassID, membershipClassID, peerGroupClassID, peerinfoClassID, pipeClassID, proxyClassID, refAccessSpecID, refDiscoverySpecID, refEndpointSpecID, refHttpProtoSpecID, refMembershipSpecID, refNetPeerGroupSpecID, refPeerinfoSpecID, refPipeSpecID, refPlatformSpecID, refProxySpecID, refRelayProtoSpecID, refRendezvousSpecID, refResolverSpecID, refRouterProtoSpecID, refShellSpecID, refStartNetPeerGroupSpecID, refTcpProtoSpecID, refTlsProtoSpecID, relayProtoClassID, rendezvousClassID, resolverClassID, routerProtoClassID, tcpProtoClassID, tlsProtoClassID, WK_ID_PREFIX
 
Fields inherited from interface net.jxta.platform.Module
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK
 
Constructor Summary
ShadowPeerGroup()
           
 
Method Summary
protected  void initFirst(PeerGroup parent, ID assignedID, Advertisement impl)
          Performs all initialization steps that need to be performed before any subclass initialization is performed.

Classes that override this method should always call super.initFirst() before doing any of their own work. This method loads and initializes all modules described in the given implementation advertisement.

This implementation initializes the configuration advertisement with that of the parent group and otherwise behave exactly like its superclass.

protected  void initLast()
          Perform all initialization steps that need to be performed after any subclass initialization is performed.

Classes that override this method should always call super.initLast after doing any of their own work.

 
Methods inherited from class net.jxta.impl.peergroup.StdPeerGroup
compatible, getAllPurposePeerGroupImplAdvertisement, getCacheManager, isCompatible, loadAllModules, mkImplAdvBuiltin, startApp, stopApp
 
Methods inherited from class net.jxta.impl.peergroup.GenericPeerGroup
addService, checkServices, decRefCount, equals, getAccessService, getConfigAdvertisement, getDiscoveryService, getEndpointService, getHomeThreadGroup, getImplAdvertisement, getInterface, getJxtaLoader, getLoader, getMembershipService, getParentGroup, getPeerAdvertisement, getPeerGroupAdvertisement, getPeerGroupID, getPeerGroupName, getPeerID, getPeerInfoService, getPeerName, getPipeService, getRendezVousService, getResolverService, getRoleMap, getWeakInterface, hashCode, init, isRendezvous, loadModule, loadModule, loadModule, loadModule, lookupService, lookupService, newGroup, newGroup, newGroup, publishGroup, removeService, setConfigAdvertisement, setJxtaLoader, unref
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowPeerGroup

public ShadowPeerGroup()
Method Detail

initFirst

protected void initFirst(PeerGroup parent,
                         ID assignedID,
                         Advertisement impl)
                  throws PeerGroupException
Performs all initialization steps that need to be performed before any subclass initialization is performed.

Classes that override this method should always call super.initFirst() before doing any of their own work. This method loads and initializes all modules described in the given implementation advertisement. Then, all modules are placed in a list and the list is processed iteratively. During each iteration, the Module.startApp(String[]) method of each module is invoked once. Iterations continue until no progress is being made or the list is empty.

The status returned by the Module.startApp(String[]) method of each module is considered as follows:

Iterations through the list stop when:

This implementation initializes the configuration advertisement with that of the parent group and otherwise behave exactly like its superclass.

Overrides:
initFirst in class StdPeerGroup
Parameters:
parent - The group that serves as a parent to this group.
assignedID - The unique ID assigned to this module. For group this is the group ID or null if a group ID has not yet been assigned. If null is passed, GenericPeerGroup choses a new group ID.
impl - The ModuleImplAdvertisement which defines this group's implementation.
Throws:
PeerGroupException

initLast

protected void initLast()
                 throws PeerGroupException
Perform all initialization steps that need to be performed after any subclass initialization is performed.

Classes that override this method should always call super.initLast after doing any of their own work.

Overrides:
initLast in class StdPeerGroup
Throws:
PeerGroupException

JXTA J2SE