org.jgroups.protocols
Class MPING
- Runnable
public class MPING
implements Runnable
Uses its own IP multicast socket to send and receive discovery requests/responses. Can be used in
conjuntion with a non-UDP transport, e.g. TCP.
The discovery is
assymetric: discovery requests are broadcast via the multicast socket, and
received via the multicast socket by everyone in the group. However, the discovery responses are sent
back via the regular transport (e.g. TCP) to the sender (discovery request contained sender's regular address,
e.g. 192.168.0.2:7800).
$Id: MPING.java,v 1.12 2005/08/11 12:43:47 belaban Exp $
down_handler , down_prot , down_queue , down_thread , down_thread_prio , log , observer , props , stack , stats , trace , up_handler , up_prot , up_queue , up_thread , up_thread_prio , warn |
down , findInitialMembers , findInitialMembersAsString , getNumInitialMembers , getNumPingRequests , getNumberOfDiscoveryRequestsSent , getTimeout , handleConnect , handleConnectOK , handleDisconnect , localAddressSet , makeView , providedUpServices , resetStats , sendGetMembersRequest , setNumInitialMembers , setNumPingRequests , setProperties , setTimeout , start , stop , up |
destroy , down , downThreadEnabled , dumpStats , enableStats , getDownProtocol , getDownQueue , getName , getProperties , getUpProtocol , getUpQueue , handleSpecialDownEvent , init , isTrace , isWarn , passDown , passUp , printStats , providedDownServices , providedUpServices , receiveDownEvent , receiveUpEvent , requiredDownServices , requiredUpServices , resetStats , setDownProtocol , setObserver , setProperties , setPropertiesInternal , setProtocolStack , setTrace , setUpProtocol , setWarn , start , startDownHandler , startUpHandler , statsEnabled , stop , stopInternal , up , upThreadEnabled |
getBindAddr
public InetAddress getBindAddr()
getMcastAddr
public InetAddress getMcastAddr()
getMcastPort
public int getMcastPort()
getName
public String getName()
- getName in interface PING
getTTL
public int getTTL()
isBindToAllInterfaces
public boolean isBindToAllInterfaces()
setBindAddr
public void setBindAddr(InetAddress bind_addr)
setBindToAllInterfaces
public void setBindToAllInterfaces(boolean bind_to_all_interfaces)
setMcastAddr
public void setMcastAddr(InetAddress mcast_addr)
setMcastPort
public void setMcastPort(int mcast_port)
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
- setProperties in interface PING
props
- - a property set containing only PING properties
- returns true if all properties were parsed properly
returns false if there are unrecnogized properties in the property set
setTTL
public void setTTL(int ip_ttl)
start
public void start()
throws Exception
This method is called on a
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called
from bottom to top. This call will replace
the
START and
START_OK events.
- start in interface Discovery
stop
public void stop()
This method is called on a
Channel.disconnect()
. Stops work (e.g. by closing multicast socket).
Will be called
from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP,
STOP_OK,
CLEANUP and
CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushed
- stop in interface PING
Copyright B) 1998-2005 Bela Ban. All Rights Reserved.