Project JXTA

net.jxta.impl.peergroup
Class ShadowPeerGroup

java.lang.Object
  extended bynet.jxta.impl.peergroup.GenericPeerGroup
      extended bynet.jxta.impl.peergroup.StdPeerGroup
          extended bynet.jxta.impl.peergroup.ShadowPeerGroup
All Implemented Interfaces:
CompatibilityEquater, Module, PeerGroup, 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 inherited from class 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. 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:

  • The list is empty: the group initialization proceeds.
  • A complete iteration was performed and all modules returned Module.START_AGAIN_STALLED: a PeerGroupException is thrown.
  • A number of complete iteration completed without any module returning Module.START_OK: a PeerGroupException is thrown. The number of complete iterations before that happens is computed as 1 + the square of the number of modules currently in the list.

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
 
Methods inherited from interface net.jxta.peergroup.PeerGroup
 

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
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