Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

net.jxta.ext.rdvpeergroup
Class RdvPeerGroup  view RdvPeerGroup download RdvPeerGroup.java

java.lang.Object
  extended bynet.jxta.peergroup.LightWeightPeerGroup
      extended bynet.jxta.ext.rdvpeergroup.RdvPeerGroup
All Implemented Interfaces:
java.util.EventListener, net.jxta.platform.Module, net.jxta.peergroup.PeerGroup, net.jxta.impl.rendezvous.rpv.PeerViewListener, net.jxta.rendezvous.RendezvousListener, net.jxta.service.Service

public class RdvPeerGroup
extends net.jxta.peergroup.LightWeightPeerGroup
implements net.jxta.impl.rendezvous.rpv.PeerViewListener, net.jxta.rendezvous.RendezvousListener

RdvPeerGroup is an LightWeighttPeerGroup that uses all the parent PeerGroup's services except for the RendezVous Service which is instantiaded by RdvPeerGroup. RdvPeerGroup allows a set of peers to run as rdv peers (control peers) within the RdvPeerGroup, other peers to be edge peers (primary peers), and other peers to simply keep track of running rdv peers (guest peers).


Nested Class Summary
 
Nested classes inherited from class net.jxta.peergroup.PeerGroup
net.jxta.peergroup.PeerGroup.GlobalRegistry
 
Field Summary
private  boolean isControlPeer
           
private  boolean isGuestPeer
           
private  boolean isPPGJoined
           
private  boolean isPrimaryPeer
           
private  net.jxta.rendezvous.RendezvousListener listener
           
private static org.apache.log4j.Logger LOG
           
private  net.jxta.peergroup.PeerGroup parentPeerGroup
           
private  net.jxta.impl.rendezvous.RendezVousServiceImpl rdvService
           
private  net.jxta.impl.rendezvous.rpv.PeerView rpv
           
private static java.lang.String serviceName
           
 
Fields inherited from class net.jxta.peergroup.LightWeightPeerGroup
 
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
RdvPeerGroup(net.jxta.protocol.PeerGroupAdvertisement adv, net.jxta.peergroup.PeerGroup parentPeerGroup)
          Constructor All classes that extend RdvPeerGroup must invoke this constructor.
 
Method Summary
private  void generateEvent(int type, net.jxta.id.ID peer)
           
private  void generateEvent(net.jxta.rendezvous.RendezvousEvent event)
           
 java.util.Enumeration getControlPeers()
          Get an Enumeration of the PeerIDs of the control peers of this RdvPeerGroup.
 net.jxta.rendezvous.RendezVousService getRendezVousService()
          null
private  java.util.Vector getRpvView()
           
 void init(net.jxta.peergroup.PeerGroup group, net.jxta.id.ID assignedID, net.jxta.document.Advertisement implAdv)
          null
 boolean isRendezvous()
          null
private  void join(boolean asControlPeer)
           
 boolean joinAsControlPeer(net.jxta.rendezvous.RendezvousListener listener)
          Joins the RdvPeerGroup as a control peer (rdv peer).
 boolean joinAsGuestPeer(net.jxta.rendezvous.RendezvousListener listener)
          Joins the RdvPeerGroup as a guest peer (PeerView only).
 boolean joinAsPrimaryPeer(net.jxta.rendezvous.RendezvousListener listener)
          Joins the RdvPeerGroup as a primary peer (edge peer).
 void leave()
          Leaves (quit) the RdvPeerGroup
 void peerViewEvent(net.jxta.impl.rendezvous.rpv.PeerViewEvent event)
          peerViewEvent the peerview event
 void rendezvousEvent(net.jxta.rendezvous.RendezvousEvent event)
          Called when an event occurs for the Rendezvous service
 int startApp(java.lang.String[] args)
          null
private  void startPeerView()
           
 void stopApp()
          null
private  void stopPeerView()
           
 void unref()
          null
 
Methods inherited from class net.jxta.peergroup.LightWeightPeerGroup
compatible, getAccessService, getAllPurposePeerGroupImplAdvertisement, getConfigAdvertisement, getDiscoveryService, getEndpointService, getHomeThreadGroup, getImplAdvertisement, getInterface, getLoader, getMembershipService, getParentGroup, getPeerAdvertisement, getPeerGroupAdvertisement, getPeerGroupID, getPeerGroupName, getPeerID, getPeerInfoService, getPeerName, getPipeService, getResolverService, getRoleMap, getWeakInterface, loadModule, loadModule, lookupService, lookupService, newGroup, newGroup, newGroup, publishGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

rdvService

private net.jxta.impl.rendezvous.RendezVousServiceImpl rdvService

parentPeerGroup

private net.jxta.peergroup.PeerGroup parentPeerGroup

isPrimaryPeer

private boolean isPrimaryPeer

isControlPeer

private boolean isControlPeer

isGuestPeer

private boolean isGuestPeer

isPPGJoined

private boolean isPPGJoined

rpv

private net.jxta.impl.rendezvous.rpv.PeerView rpv

serviceName

private static java.lang.String serviceName

listener

private net.jxta.rendezvous.RendezvousListener listener
Constructor Detail

RdvPeerGroup

public RdvPeerGroup(net.jxta.protocol.PeerGroupAdvertisement adv,
                    net.jxta.peergroup.PeerGroup parentPeerGroup)
Constructor All classes that extend RdvPeerGroup must invoke this constructor. Note that this constructor does not join the PeerGroup.

Method Detail

joinAsPrimaryPeer

public boolean joinAsPrimaryPeer(net.jxta.rendezvous.RendezvousListener listener)
                          throws java.io.IOException
Joins the RdvPeerGroup as a primary peer (edge peer).


joinAsControlPeer

public boolean joinAsControlPeer(net.jxta.rendezvous.RendezvousListener listener)
                          throws java.io.IOException
Joins the RdvPeerGroup as a control peer (rdv peer).


joinAsGuestPeer

public boolean joinAsGuestPeer(net.jxta.rendezvous.RendezvousListener listener)
                        throws java.io.IOException
Joins the RdvPeerGroup as a guest peer (PeerView only).


leave

public void leave()
Leaves (quit) the RdvPeerGroup


getControlPeers

public java.util.Enumeration getControlPeers()
Get an Enumeration of the PeerIDs of the control peers of this RdvPeerGroup. Note that the result may be null if the RdvPeerGroup is not yet connected.


join

private void join(boolean asControlPeer)
           throws java.io.IOException

startPeerView

private void startPeerView()

stopPeerView

private void stopPeerView()

getRpvView

private java.util.Vector getRpvView()

rendezvousEvent

public void rendezvousEvent(net.jxta.rendezvous.RendezvousEvent event)
Called when an event occurs for the Rendezvous service

Specified by:
rendezvousEvent in interface net.jxta.rendezvous.RendezvousListener

peerViewEvent

public void peerViewEvent(net.jxta.impl.rendezvous.rpv.PeerViewEvent event)
peerViewEvent the peerview event

Specified by:
peerViewEvent in interface net.jxta.impl.rendezvous.rpv.PeerViewListener

generateEvent

private void generateEvent(int type,
                           net.jxta.id.ID peer)

generateEvent

private void generateEvent(net.jxta.rendezvous.RendezvousEvent event)

init

public void init(net.jxta.peergroup.PeerGroup group,
                 net.jxta.id.ID assignedID,
                 net.jxta.document.Advertisement implAdv)
null

Specified by:
init in interface net.jxta.platform.Module

startApp

public int startApp(java.lang.String[] args)
null

Specified by:
startApp in interface net.jxta.platform.Module

stopApp

public void stopApp()
null

Specified by:
stopApp in interface net.jxta.platform.Module

isRendezvous

public boolean isRendezvous()
null

Specified by:
isRendezvous in interface net.jxta.peergroup.PeerGroup

getRendezVousService

public net.jxta.rendezvous.RendezVousService getRendezVousService()
Description copied from class: net.jxta.peergroup.LightWeightPeerGroup
null

Specified by:
getRendezVousService in interface net.jxta.peergroup.PeerGroup

unref

public void unref()
Description copied from class: net.jxta.peergroup.LightWeightPeerGroup
null

Specified by:
unref in interface net.jxta.peergroup.PeerGroup