org.jgroups.protocols

Class PING

public class PING extends Discovery

The PING protocol layer retrieves the initial membership (used by the GMS when started by sending event FIND_INITIAL_MBRS down the stack). We do this by mcasting PING requests to an IP MCAST address (or, if gossiping is enabled, by contacting the GossipServer). The responses should allow us to determine the coordinator whom we have to contact, e.g. in case we want to join the group. When we are a server (after having received the BECOME_SERVER event), we'll respond to PING requests with a PING response.

The FIND_INITIAL_MBRS event will eventually be answered with a FIND_INITIAL_MBRS_OK event up the stack. The following properties are available property: gossip_host - if you are using GOSSIP then this defines the host of the GossipServer, default is null property: gossip_port - if you are using GOSSIP then this defines the port of the GossipServer, default is null

Field Summary
static Stringname
Method Summary
StringgetName()
voidhandleConnect()
voidhandleDisconnect()
voidlocalAddressSet(Address addr)
voidsendGetMembersRequest()
booleansetProperties(Properties props)
sets the properties of the PING protocol.
voidstop()

Field Detail

name

public static final String name

Method Detail

getName

public String getName()

handleConnect

public void handleConnect()

handleDisconnect

public void handleDisconnect()

localAddressSet

public void localAddressSet(Address addr)

sendGetMembersRequest

public void sendGetMembersRequest()

setProperties

public boolean setProperties(Properties props)
sets the properties of the PING protocol. The following properties are available property: timeout - the timeout (ms) to wait for the initial members, default is 3000=3 secs property: num_initial_members - the minimum number of initial members for a FIND_INITAL_MBRS, default is 2 property: gossip_host - if you are using GOSSIP then this defines the host of the GossipServer, default is null property: gossip_port - if you are using GOSSIP then this defines the port of the GossipServer, default is null

Parameters: props - a property set containing only PING properties

Returns: returns true if all properties were parsed properly returns false if there are unrecnogized properties in the property set

stop

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