JXTA

net.jxta.impl.peergroup
Class Platform

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

public class Platform
extends StdPeerGroup

Provides the implementation for the World PeerGroup. The World peer group differs from other peer groups in the following ways :


Nested Class Summary
 
Nested classes/interfaces inherited from class net.jxta.impl.peergroup.GenericPeerGroup
GenericPeerGroup.PeerGroupThreadFactory
 
Nested classes/interfaces inherited from interface net.jxta.peergroup.PeerGroup
PeerGroup.GlobalRegistry
 
Field Summary
 
Fields inherited from class net.jxta.impl.peergroup.StdPeerGroup
MODULE_IMPL_STD_PROVIDER, MODULE_IMPL_STD_URI, STD_COMPAT, STD_COMPAT_BINDING, STD_COMPAT_BINDING_VALUE, STD_COMPAT_FORMAT, STD_COMPAT_FORMAT_VALUE
 
Fields inherited from class net.jxta.impl.peergroup.GenericPeerGroup
configAdvertisement, implAdvertisement, initComplete, jxtaHome, 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, 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_DISABLED, START_OK
 
Constructor Summary
Platform()
          This constructor was originally the standard constructor and must be retained in case the World PeerGroup is accidentally instantiated via the module loading infrastructure.
Platform(ConfigParams config, URI storeHome)
          Default constructor
 
Method Summary
protected  void checkServices()
          check that all required core services are registered
 ModuleImplAdvertisement getAllPurposePeerGroupImplAdvertisement()
          Returns a ModuleImplAdvertisement suitable for the Network Peer Group.
static ModuleImplAdvertisement getDefaultModuleImplAdvertisement()
          Create and populate the default module impl Advertisement for this class.
protected  void initFirst(PeerGroup nullParent, ID assignedID, Advertisement impl)
          Performs all initialization steps that need to be performed before any subclass initialization is performed.
protected  void initLast()
          Perform all initialization steps that need to be performed after any subclass initialization is performed.
 
Methods inherited from class net.jxta.impl.peergroup.StdPeerGroup
compatible, getApplications, getCacheManager, isCompatible, loadAllModules, mkImplAdvBuiltin, startApp, stopApp
 
Methods inherited from class net.jxta.impl.peergroup.GenericPeerGroup
addService, decRefCount, equals, getAccessService, getConfigAdvertisement, getDiscoveryService, getEndpointService, getExecutor, getHomeThreadGroup, getImplAdvertisement, getInterface, getJxtaLoader, getLoader, getMembershipService, getParentGroup, getPeerAdvertisement, getPeerGroupAdvertisement, getPeerGroupID, getPeerGroupName, getPeerID, getPeerInfoService, getPeerName, getPipeService, getRendezVousService, getResolverService, getRoleMap, getScheduledExecutor, getStoreHome, getWeakInterface, hashCode, init, isRendezvous, loadModule, loadModule, loadModule, loadModule, lookupService, lookupService, newGroup, newGroup, newGroup, publishGroup, removeService, setConfigAdvertisement, setGroupConfigAdvertisement, setStoreHome, toString, unref
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Platform

public Platform()
         throws PeerGroupException
This constructor was originally the standard constructor and must be retained in case the World PeerGroup is accidentally instantiated via the module loading infrastructure.

Throws:
PeerGroupException - if an initialization error occurs

Platform

public Platform(ConfigParams config,
                URI storeHome)
Default constructor

Parameters:
config - The configuration.
storeHome - Persistent store home.
Method Detail

getDefaultModuleImplAdvertisement

public static ModuleImplAdvertisement getDefaultModuleImplAdvertisement()
Create and populate the default module impl Advertisement for this class.

Returns:
The default module impl advertisement for this class.

initFirst

protected void initFirst(PeerGroup nullParent,
                         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 of the peer group modules described in the provided 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:

Overrides:
initFirst in class StdPeerGroup
Parameters:
nullParent - 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 will generate a new group ID.
impl - The ModuleImplAdvertisement which defines this group's implementation.
Throws:
PeerGroupException - if a group initialization error occurs

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.

Nothing special for now, but we might want to move some steps from initFirst() in the future.

Overrides:
initLast in class StdPeerGroup
Throws:
PeerGroupException - if a group initialization error occurs

getAllPurposePeerGroupImplAdvertisement

public ModuleImplAdvertisement getAllPurposePeerGroupImplAdvertisement()
Returns a ModuleImplAdvertisement suitable for the Network Peer Group.

The ModuleImplAdvertisement returned differs from the one returned by StdPeerGroup in that it has a different specID, name and description, as well as the high-level message transports . This definition is always the same and has a well known ModuleSpecID. It includes the basic services, high-level message transports and the shell for main application.

Specified by:
getAllPurposePeerGroupImplAdvertisement in interface PeerGroup
Overrides:
getAllPurposePeerGroupImplAdvertisement in class StdPeerGroup
Returns:
A ModuleImplAdvertisement suitable for the Network Peer Group.

checkServices

protected void checkServices()
                      throws ServiceNotFoundException
check that all required core services are registered

Overrides:
checkServices in class GenericPeerGroup
Throws:
ServiceNotFoundException - If a required service was not found.

JXSE