Project JXTA

net.jxta.impl.peergroup
Class PeerGroupInterface

java.lang.Object
  extended bynet.jxta.impl.peergroup.PeerGroupInterface
All Implemented Interfaces:
Module, PeerGroup, Service
Direct Known Subclasses:
RefCountPeerGroupInterface

class PeerGroupInterface
extends Object
implements PeerGroup

PeerGroupInterface provides a pure interface object that permits interaction with the actual PeerGroup implementation without giving access to the real object. This class defines immutable objects. It has no control over the wrapped peer group object's life cycle. It serves to make weak PeerGroup interface object.


Nested Class Summary
 
Nested classes inherited from class net.jxta.peergroup.PeerGroup
PeerGroup.GlobalRegistry
 
Field Summary
protected  PeerGroup groupImpl
          The peer group instance which backs this interface object.
 
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
(package private) PeerGroupInterface(PeerGroup theRealThing)
          Constructs an interface object that front-ends a given GenericPeerGroup.
 
Method Summary
 boolean compatible(Element compat)
          
 AccessService getAccessService()
          
 ModuleImplAdvertisement getAllPurposePeerGroupImplAdvertisement()
          
 ConfigParams getConfigAdvertisement()
          
 DiscoveryService getDiscoveryService()
          
 EndpointService getEndpointService()
          
 ThreadGroup getHomeThreadGroup()
          
 Advertisement getImplAdvertisement()
          
 Service getInterface()
          
 JxtaLoader getLoader()
          
 MembershipService getMembershipService()
          
 PeerGroup getParentGroup()
           
 PeerAdvertisement getPeerAdvertisement()
          
 PeerGroupAdvertisement getPeerGroupAdvertisement()
          
 PeerGroupID getPeerGroupID()
          
 String getPeerGroupName()
          
 PeerID getPeerID()
          
 PeerInfoService getPeerInfoService()
          
 String getPeerName()
          
 PipeService getPipeService()
          
 RendezVousService getRendezVousService()
          
 ResolverService getResolverService()
          
 Iterator getRoleMap(ID name)
          
 PeerGroup getWeakInterface()
          
 void init(PeerGroup pg, ID assignedID, Advertisement impl)
          This is here for class hierarchy reasons.
 boolean isRendezvous()
          
 Module loadModule(ID assignedID, Advertisement impl)
           FIXME: jice@jxta.org 20031103 Idealy, we'd need the groupAPI to offer a means to loadModule() without making a counted reference, so that group services can loadModule() things without preventing group termination.
 Module loadModule(ID assignedID, ModuleSpecID specID, int where)
          
 Service lookupService(ID name)
          
 Service lookupService(ID name, int roleIndex)
          
 PeerGroup newGroup(Advertisement pgAdv)
          
 PeerGroup newGroup(PeerGroupID gid)
          
 PeerGroup newGroup(PeerGroupID gid, Advertisement impl, String name, String description)
          
 void publishGroup(String name, String description)
          
 int startApp(String[] arg)
          This is here for class hierarchy reasons.
 void stopApp()
          This is here for class hierarchy reasons.
 void unref()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.jxta.peergroup.PeerGroup
 

Field Detail

groupImpl

protected PeerGroup groupImpl
The peer group instance which backs this interface object.

Constructor Detail

PeerGroupInterface

PeerGroupInterface(PeerGroup theRealThing)
Constructs an interface object that front-ends a given GenericPeerGroup.

Method Detail

init

public void init(PeerGroup pg,
                 ID assignedID,
                 Advertisement impl)
This is here for class hierarchy reasons. it is normaly ignored. By definition, the interface object protects the real object's start/stop methods from being called

Specified by:
init in interface Module

startApp

public int startApp(String[] arg)
This is here for class hierarchy reasons. it is normaly ignored. By definition, the interface object protects the real object's start/stop methods from being called

Specified by:
startApp in interface Module

stopApp

public void stopApp()
This is here for class hierarchy reasons. it is normaly ignored. By definition, the interface object protects the real object's start/stop methods from being called

Specified by:
stopApp in interface Module

getInterface

public Service getInterface()

Specified by:
getInterface in interface Service
Returns:
Service self

getWeakInterface

public PeerGroup getWeakInterface()

Specified by:
getWeakInterface in interface PeerGroup
Returns:
Service self

unref

public void unref()
Specified by:
unref in interface PeerGroup

getImplAdvertisement

public Advertisement getImplAdvertisement()

Specified by:
getImplAdvertisement in interface Service

getHomeThreadGroup

public ThreadGroup getHomeThreadGroup()

Specified by:
getHomeThreadGroup in interface PeerGroup

getLoader

public JxtaLoader getLoader()

Specified by:
getLoader in interface PeerGroup

isRendezvous

public boolean isRendezvous()

Specified by:
isRendezvous in interface PeerGroup

getPeerGroupAdvertisement

public PeerGroupAdvertisement getPeerGroupAdvertisement()

Specified by:
getPeerGroupAdvertisement in interface PeerGroup

getPeerAdvertisement

public PeerAdvertisement getPeerAdvertisement()

Specified by:
getPeerAdvertisement in interface PeerGroup

lookupService

public Service lookupService(ID name)
                      throws ServiceNotFoundException

Specified by:
lookupService in interface PeerGroup
Throws:
ServiceNotFoundException

lookupService

public Service lookupService(ID name,
                             int roleIndex)
                      throws ServiceNotFoundException

Specified by:
lookupService in interface PeerGroup
Throws:
ServiceNotFoundException

getRoleMap

public Iterator getRoleMap(ID name)

Specified by:
getRoleMap in interface PeerGroup

compatible

public boolean compatible(Element compat)

Specified by:
compatible in interface PeerGroup

loadModule

public Module loadModule(ID assignedID,
                         Advertisement impl)
                  throws ProtocolNotSupportedException,
                         PeerGroupException
FIXME: jice@jxta.org 20031103 Idealy, we'd need the groupAPI to offer a means to loadModule() without making a counted reference, so that group services can loadModule() things without preventing group termination. This could be achieved elegantly by making this the only behaviour available through a weak GroupInterface. So it would be enough to obtain a weak interface from one's group and then use its loadmodule method rather than that of the strong group reference. However that's a bit too big a change to be decided without more carefull consideration.

Specified by:
loadModule in interface PeerGroup
Throws:
ProtocolNotSupportedException
PeerGroupException

loadModule

public Module loadModule(ID assignedID,
                         ModuleSpecID specID,
                         int where)

Specified by:
loadModule in interface PeerGroup

publishGroup

public void publishGroup(String name,
                         String description)
                  throws IOException

Specified by:
publishGroup in interface PeerGroup
Throws:
IOException

newGroup

public PeerGroup newGroup(Advertisement pgAdv)
                   throws PeerGroupException

Specified by:
newGroup in interface PeerGroup
Throws:
PeerGroupException

newGroup

public PeerGroup newGroup(PeerGroupID gid,
                          Advertisement impl,
                          String name,
                          String description)
                   throws PeerGroupException

Specified by:
newGroup in interface PeerGroup
Throws:
PeerGroupException

newGroup

public PeerGroup newGroup(PeerGroupID gid)
                   throws PeerGroupException

Specified by:
newGroup in interface PeerGroup
Throws:
PeerGroupException

getRendezVousService

public RendezVousService getRendezVousService()

Specified by:
getRendezVousService in interface PeerGroup

getEndpointService

public EndpointService getEndpointService()

Specified by:
getEndpointService in interface PeerGroup

getResolverService

public ResolverService getResolverService()

Specified by:
getResolverService in interface PeerGroup

getDiscoveryService

public DiscoveryService getDiscoveryService()

Specified by:
getDiscoveryService in interface PeerGroup

getPeerInfoService

public PeerInfoService getPeerInfoService()

Specified by:
getPeerInfoService in interface PeerGroup

getMembershipService

public MembershipService getMembershipService()

Specified by:
getMembershipService in interface PeerGroup

getPipeService

public PipeService getPipeService()

Specified by:
getPipeService in interface PeerGroup

getAccessService

public AccessService getAccessService()

Specified by:
getAccessService in interface PeerGroup

getPeerGroupID

public PeerGroupID getPeerGroupID()

Specified by:
getPeerGroupID in interface PeerGroup

getPeerID

public PeerID getPeerID()

Specified by:
getPeerID in interface PeerGroup

getPeerGroupName

public String getPeerGroupName()

Specified by:
getPeerGroupName in interface PeerGroup

getPeerName

public String getPeerName()

Specified by:
getPeerName in interface PeerGroup

getConfigAdvertisement

public ConfigParams getConfigAdvertisement()

Specified by:
getConfigAdvertisement in interface PeerGroup

getAllPurposePeerGroupImplAdvertisement

public ModuleImplAdvertisement getAllPurposePeerGroupImplAdvertisement()
                                                                throws Exception

Specified by:
getAllPurposePeerGroupImplAdvertisement in interface PeerGroup
Throws:
Exception

getParentGroup

public PeerGroup getParentGroup()
Specified by:
getParentGroup in interface PeerGroup

JXTA J2SE