org.jgroups.stack

Class GossipClient

public class GossipClient extends 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.

Author: Bela Ban Oct 4 2001

UNKNOWN: Make access to multiple GossipServer concurrent (1 thread/GossipServer).

Field Summary
protected Loglog
Constructor Summary
GossipClient(IpAddress gossip_host, long expiry)
Creates the GossipClient
GossipClient(Vector gossip_hosts, long expiry)
Creates the GossipClient
Method Summary
voidaddGossipServer(IpAddress gossip_host)
Adds a GossipServer to be accessed.
VectorgetMembers(String group)
Returns all members of a given group
static voidmain(String[] args)
voidregister(String group, Address mbr)
Adds the member to the given group.
voidstop()

Field Detail

log

protected final 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(Vector gossip_hosts, long expiry)
Creates the GossipClient

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

Method Detail

addGossipServer

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

getMembers

public Vector getMembers(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(String[] args)

register

public void register(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

stop

public void stop()
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.