org.jgroups.protocols
Class TCPPING

java.lang.Object
  extended by org.jgroups.stack.Protocol
      extended by org.jgroups.protocols.Discovery
          extended by org.jgroups.protocols.TCPPING

public class TCPPING
extends Discovery

The TCPPING protocol layer retrieves the initial membership in answer to the GMS's FIND_INITIAL_MBRS event. The initial membership is retrieved by directly contacting other group members, sending point-to-point mebership requests. The responses should allow us to determine the coordinator whom we have to contact in case we want to join the group. When we are a server (after having received the BECOME_SERVER event), we'll respond to TCPPING requests with a TCPPING response.

The FIND_INITIAL_MBRS event will eventually be answered with a FIND_INITIAL_MBRS_OK event up the stack.

The TCPPING protocol requires a static conifiguration, which assumes that you to know in advance where to find other members of your group. For dynamic discovery, use the PING protocol, which uses multicast discovery, or the TCPGOSSIP protocol, which contacts a Gossip Router to acquire the initial membership.

Author:
Bela Ban

Field Summary
 
Fields inherited from class org.jgroups.stack.Protocol
down_prot, log, props, stack, stats, up_prot
 
Constructor Summary
TCPPING()
           
 
Method Summary
 java.util.List<Address> getInitialHosts()
          Returns the list of initial hosts as configured by the user via XML.
 java.lang.String getName()
           
 void localAddressSet(Address addr)
          Called after local_addr was set
 void sendGetMembersRequest(Promise promise)
           
 boolean setProperties(java.util.Properties props)
          sets the properties of the PING protocol.
 
Methods inherited from class org.jgroups.protocols.Discovery
down, findInitialMembers, findInitialMembersAsString, getNumberOfDiscoveryRequestsSent, getNumInitialMembers, getNumPingRequests, getTimeout, handleConnect, handleDisconnect, init, makeView, providedUpServices, resetStats, setNumInitialMembers, setNumPingRequests, setTimeout, start, stop, up
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getProperties, getProtocolStack, getThreadFactory, getTransport, getUpProtocol, printStats, providedDownServices, requiredDownServices, requiredUpServices, setDownProtocol, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, upThreadEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPPING

public TCPPING()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Protocol

getInitialHosts

public java.util.List<Address> getInitialHosts()
Returns the list of initial hosts as configured by the user via XML. Note that the returned list is mutable, so careful with changes !

Returns:
List
list of initial hosts. This variable is only set after the channel has been created and set Properties() has been called

setProperties

public boolean setProperties(java.util.Properties props)
Description copied from class: Discovery
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

Overrides:
setProperties in class Discovery
Parameters:
props - - a property set
Returns:
returns true if all properties were parsed properly returns false if there are unrecnogized properties in the property set

localAddressSet

public void localAddressSet(Address addr)
Description copied from class: Discovery
Called after local_addr was set

Overrides:
localAddressSet in class Discovery

sendGetMembersRequest

public void sendGetMembersRequest(Promise promise)
                           throws java.lang.Exception
Specified by:
sendGetMembersRequest in class Discovery
Throws:
java.lang.Exception


Copyright ? 1998-2008 Bela Ban. All Rights Reserved.