org.jgroups.stack
Class GossipClient

java.lang.Object
  extended byorg.jgroups.stack.GossipClient

public class GossipClient
extends java.lang.Object

Local stub for clients to access one (or more) GossipServers. Will use proprietary protocol (using GossipData PDUs) based on TCP to connect to GossipServer.

Requires JDK >= 1.3 due to the use of Timer

todo: make access to multiple GossipServer concurrent (1 thread/GossipServer)

Author:
Bela Ban Oct 4 2001

Field Summary
protected  Log log
           
 
Constructor Summary
GossipClient(IpAddress gossip_host, long expiry)
          Creates the GossipClient
GossipClient(java.util.Vector gossip_hosts, long expiry)
          Creates the GossipClient
 
Method Summary
 void addGossipServer(IpAddress gossip_host)
          Adds a GossipServer to be accessed.
 java.util.Vector getMembers(java.lang.String group)
          Returns all members of a given group
static void main(java.lang.String[] args)
           
 void register(java.lang.String group, Address mbr)
          Adds the member to the given group.
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Log log
Constructor Detail

GossipClient

public GossipClient(IpAddress gossip_host,
                    long expiry)
Creates the GossipClient

Parameters:
gossip_host - The address and port of the host on which the GossipServer is running
expiry - Interval (in msecs) for the refresher task

GossipClient

public GossipClient(java.util.Vector gossip_hosts,
                    long expiry)
Creates the GossipClient

Parameters:
gossip_hosts - List of IpAddresses
expiry - Interval (in msecs) for the refresher task
Method Detail

stop

public void stop()

addGossipServer

public void addGossipServer(IpAddress gossip_host)
Adds a GossipServer to be accessed.


register

public void register(java.lang.String group,
                     Address mbr)
Adds the member to the given group. If the group already has an entry for the member, its timestamp will be updated, preventing the cache cleaner from removing the entry.

The entry will be registered with all GossipServers that GossipClient is configured to access


getMembers

public java.util.Vector getMembers(java.lang.String group)
Returns all members of a given group

Parameters:
group - The group name
Returns:
Vector A list of Addresses

main

public static void main(java.lang.String[] args)


Copyright ? 2001,2002 www.jgroups.com . All Rights Reserved.