|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Peer groups are formed as a collection of peers that have agreed upon a common set of services. Each peer group is assigned a unique peer group ID and a peer group advertisement. The peer group advertisement contains a ModuleSpecID which refers to a module specification for this peer group.
The peer group specification mandates each of the group services (membership, discovery, resolver, etc). Implementations of that specification are described by ModuleImplAdvertisements which are identified by the group's ModuleSpecID. Implementations are responsible for providing the services mandated by the specification. The java reference implementation achieves this by loading additional Modules which ModuleSpecIDs are listed by the group implementation advertisement.
In order to participate in a group, a peer needs to join the group using the peer group membership service.
JXTA comes with two subclasses of peer groups:
PeerGroupID,
Service,
PeerGroupFactory,
PeerGroupAdvertisement,
ModuleImplAdvertisement,
ModuleSpecID,
ModuleClassID| Inner Class Summary | |
static class |
PeerGroup.GlobalRegistry
|
static class |
PeerGroup.IdMaker
An inner class used to create static well-known identifiers. |
| Field Summary | |
static ModuleSpecID |
allPurposePeerGroupSpecID
Well known group specification identifier: an all purpose peer group specification. |
static ModuleClassID |
applicationClassID
Well known module class identifier: application |
static int |
Both
Look for needed ModuleImplAdvertisement in both this group and its parent. |
static long |
DEFAULT_EXPIRATION
Default expiration time for discovered group advertisements. |
static long |
DEFAULT_LIFETIME
Default life time for group advertisements in the publisher's cache. |
static ModuleClassID |
discoveryClassID
Well known module class identifier: discovery service |
static ModuleClassID |
endpointClassID
Well known module class identifier: endpoint service |
static int |
FromParent
Look for needed ModuleImplAdvertisement in the parent group of this group. |
static PeerGroup.GlobalRegistry |
globalRegistry
|
static int |
Here
Look for needed ModuleImplAdvertisement in this group. |
static ModuleClassID |
httpProtoClassID
Well known module class identifier: http protocol |
static ModuleClassID |
membershipClassID
Well known module class identifier: membership service |
static ModuleClassID |
peerGroupClassID
Well known module class identifier: peer group |
static ModuleClassID |
peerinfoClassID
Well known module class identifier: peerinfo service |
static ModuleClassID |
pipeClassID
Well known module class identifier: pipe service |
static ModuleClassID |
proxyClassID
Well known module class identifier: ProxyService |
static ModuleSpecID |
refDiscoverySpecID
Well known service specification identifier: the standard discovery |
static ModuleSpecID |
refEndpointSpecID
Well known service specification identifier: the standard endpoint |
static ModuleSpecID |
refHttpProtoSpecID
Well known endpoint protocol specification identifier: the standard http endpoint protocol |
static ModuleSpecID |
refMembershipSpecID
Well known service specification identifier: the standard membership |
static ModuleSpecID |
refNetPeerGroupSpecID
Well known group specification identifier: the Network Peer Group |
static ModuleSpecID |
refPeerinfoSpecID
Well known service specification identifier: the standard peerinfo |
static ModuleSpecID |
refPipeSpecID
Well known service specification identifier: the standard pipe |
static ModuleSpecID |
refPlatformSpecID
Well known group specification identifier: the platform |
static ModuleSpecID |
refProxySpecID
Well known application: the Proxy |
static ModuleSpecID |
refRendezvousSpecID
Well known service specification identifier: the standard rendezvous |
static ModuleSpecID |
refResolverSpecID
Well known service specification identifier: the standard resolver |
static ModuleSpecID |
refRouterProtoSpecID
Well known endpoint protocol specification identifier: the standard router |
static ModuleSpecID |
refShellSpecID
Well known application: the shell |
static ModuleSpecID |
refStartNetPeerGroupSpecID
Well known main application of the platform: startNetPeerGroup. |
static ModuleSpecID |
refTcpProtoSpecID
Well known endpoint protocol specification identifier: the standard tcp endpoint protocol |
static ModuleSpecID |
refTlsProtoSpecID
Well known endpoint protocol specification identifier: the standard tls endpoint protocol |
static ModuleClassID |
rendezvousClassID
Well known module class identifier: rendezvous service |
static ModuleClassID |
resolverClassID
Well known module class identifier: resolver service |
static ModuleClassID |
routerProtoClassID
Well known module class identifier: router protocol |
static ModuleClassID |
tcpProtoClassID
Well known module class identifier: tcp protocol |
static ModuleClassID |
tlsProtoClassID
Well known module class identifier: tlsProtocol |
| Method Summary | |
boolean |
compatible(Element compat)
Evaluate if the given compatibility statement make the module that bears it loadable by this group. |
ModuleImplAdvertisement |
getAllPurposePeerGroupImplAdvertisement()
Get an allPurpose peerGroup ModuleImplAdvertisement compatible with this group. |
Advertisement |
getConfigAdvertisement()
Returns the config advertisment for this peer in this group (if any). |
DiscoveryService |
getDiscoveryService()
|
EndpointService |
getEndpointService()
|
JxtaLoader |
getLoader()
Returns the loader for this group. |
MembershipService |
getMembershipService()
|
PeerAdvertisement |
getPeerAdvertisement()
Ask a group for its peer advertisement on this peer. |
PeerGroupAdvertisement |
getPeerGroupAdvertisement()
Ask a group for its group advertisement |
PeerGroupID |
getPeerGroupID()
Tell the ID of this group. |
java.lang.String |
getPeerGroupName()
Tell the Name of this group. |
PeerID |
getPeerID()
Tell the ID of this peer in this group. |
PeerInfoService |
getPeerInfoService()
|
java.lang.String |
getPeerName()
Tell the Name of this peer in this group. |
PipeService |
getPipeService()
|
RendezVousService |
getRendezVousService()
|
ResolverService |
getResolverService()
|
boolean |
isRendezvous()
Returns the whether the group member is a Rendezvous peer for the group |
Module |
loadModule(ID assignedID,
Advertisement impl)
Load a module from a ModuleImplAdv. |
Module |
loadModule(ID assignedID,
ModuleSpecID specID,
int where)
Load a module from a spec id. |
Service |
lookupService(ID name)
Lookup for a service by name. |
PeerGroup |
newGroup(Advertisement pgAdv)
Instantiate a group from its given advertisement Use this when a published implAdv for the groupSubclass can be discovered. |
PeerGroup |
newGroup(PeerGroupID gid)
Instantiate a group from its groupID only. |
PeerGroup |
newGroup(PeerGroupID gid,
Advertisement impl,
java.lang.String name,
java.lang.String description)
Convenience method, instantiate a group from its elementary pieces and publish the corresponding PeerGroupAdvertisement. |
void |
publishGroup(java.lang.String name,
java.lang.String description)
Force publication of this group if hasn't been done already. |
void |
unref()
|
| Methods inherited from interface net.jxta.service.Service |
getImplAdvertisement, getInterface |
| Methods inherited from interface net.jxta.platform.Module |
init, startApp, stopApp |
| Field Detail |
public static final int Here
public static final int FromParent
public static final int Both
public static final long DEFAULT_LIFETIME
public static final long DEFAULT_EXPIRATION
public static final ModuleClassID peerGroupClassID
public static final ModuleClassID resolverClassID
public static final ModuleClassID discoveryClassID
public static final ModuleClassID pipeClassID
public static final ModuleClassID membershipClassID
public static final ModuleClassID rendezvousClassID
public static final ModuleClassID peerinfoClassID
public static final ModuleClassID endpointClassID
public static final ModuleClassID tcpProtoClassID
public static final ModuleClassID httpProtoClassID
public static final ModuleClassID routerProtoClassID
public static final ModuleClassID applicationClassID
public static final ModuleClassID tlsProtoClassID
public static final ModuleClassID proxyClassID
public static final ModuleSpecID refPlatformSpecID
public static final ModuleSpecID refNetPeerGroupSpecID
public static final ModuleSpecID refResolverSpecID
public static final ModuleSpecID refDiscoverySpecID
public static final ModuleSpecID refPipeSpecID
public static final ModuleSpecID refMembershipSpecID
public static final ModuleSpecID refRendezvousSpecID
public static final ModuleSpecID refPeerinfoSpecID
public static final ModuleSpecID refEndpointSpecID
public static final ModuleSpecID refTcpProtoSpecID
public static final ModuleSpecID refHttpProtoSpecID
public static final ModuleSpecID refRouterProtoSpecID
public static final ModuleSpecID refTlsProtoSpecID
public static final ModuleSpecID allPurposePeerGroupSpecID
public static final ModuleSpecID refStartNetPeerGroupSpecID
public static final ModuleSpecID refShellSpecID
public static final ModuleSpecID refProxySpecID
public static final PeerGroup.GlobalRegistry globalRegistry
| Method Detail |
public JxtaLoader getLoader()
public boolean isRendezvous()
public PeerGroupAdvertisement getPeerGroupAdvertisement()
public PeerAdvertisement getPeerAdvertisement()
public Service lookupService(ID name)
throws ServiceNotFoundException
name - the service identifier.ServiceNotFoundException - could not find the service requestedpublic boolean compatible(Element compat)
public Module loadModule(ID assignedID,
Advertisement impl)
throws ProtocolNotSupportedException,
PeerGroupException
ID - Id to be assigned to that module (usually its ClassID).impl - An implementation advertisement for that module.ProtocolNotSupportedException - The module is a protocol and
is disabled per the peer's configuration.PeerGroupException - The module could not be loaded or initialized
public Module loadModule(ID assignedID,
ModuleSpecID specID,
int where)
ID - Id to be assigned to that module (usually its ClassID).specID - The specID of this module.where - May be one of: Here, FromParent, or Both, meaning that the
implementation advertisement will be searched in this group, its parent
or both. As a general guideline, the implementation advertisements of
a group should be searched in its propsective parent (that is Here), the
implementation advertisements of a group standard service should be
searched in the same group than where this group's advertisement was
found (that is, FromParent), while applications may be sought more
freely (Both).
public void publishGroup(java.lang.String name,
java.lang.String description)
throws java.io.IOException
name - The name of this group.Description - The description of this group.java.io.IOException - The publication could not be accomplished
because of a network or storage failure.
public PeerGroup newGroup(Advertisement pgAdv)
throws PeerGroupException
pgAdv - The advertisement of that group.PeerGroupException - The group could ne be instantated.
public PeerGroup newGroup(PeerGroupID gid,
Advertisement impl,
java.lang.String name,
java.lang.String description)
throws PeerGroupException
gid - The ID of that group.impl - The advertisement of the implementation to be used.name - The name of the group.description - A description of this group.PeerGroupException - The group could ne be instantated.
public PeerGroup newGroup(PeerGroupID gid)
throws PeerGroupException
gid - the groupID.PeerGroupException - The group could ne be instantated.public RendezVousService getRendezVousService()
public EndpointService getEndpointService()
public ResolverService getResolverService()
public DiscoveryService getDiscoveryService()
public PeerInfoService getPeerInfoService()
public MembershipService getMembershipService()
public PipeService getPipeService()
public PeerGroupID getPeerGroupID()
public PeerID getPeerID()
public java.lang.String getPeerGroupName()
public java.lang.String getPeerName()
public Advertisement getConfigAdvertisement()
public ModuleImplAdvertisement getAllPurposePeerGroupImplAdvertisement()
throws java.lang.Exception
public void unref()
|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||