org.jgroups.protocols
Class FD_ICMP

java.lang.Object
  extended by org.jgroups.stack.Protocol
      extended by org.jgroups.protocols.FD
          extended by org.jgroups.protocols.FD_ICMP

public class FD_ICMP
extends FD

Protocol which uses InetAddress.isReachable() to check whether a given host is up or not, taking 1 argument; the host name of the host to be pinged. Note that this protocol only works with a JDK version >= 5 ! The implementation of this may or may not use ICMP ! An alternative is to create a TCP connection to port 7 (echo service) and see whether it works ! This is done in JDK 5, so unless an echo service is configured to run, this won't work...

Author:
Bela Ban

Nested Class Summary
protected  class FD_ICMP.PingMonitor
          Runs InetAddress.isReachable().
 
Nested classes/interfaces inherited from class org.jgroups.protocols.FD
FD.Broadcaster, FD.BroadcastTask, FD.FdHeader, FD.Monitor
 
Field Summary
protected  java.lang.String bind_interface_str
           
protected  int ttl
          Time-to-live for InetAddress.isReachable()
 
Fields inherited from class org.jgroups.protocols.FD
bcast_task, last_ack, local_addr, lock, max_tries, members, monitor_future, num_heartbeats, num_suspect_events, num_tries, ping_dest, pingable_mbrs, suspect_history, timeout, timer
 
Fields inherited from class org.jgroups.stack.Protocol
down_prot, ergonomics, id, log, name, stack, stats, up_prot
 
Constructor Summary
FD_ICMP()
           
 
Method Summary
protected  FD.Monitor createMonitor()
           
 void init()
          Called after instance has been created (null constructor) and before protocol is started.
 java.lang.Object up(Event evt)
          An event was received from the layer below.
 
Methods inherited from class org.jgroups.protocols.FD
computePingDest, down, getCurrentNumTries, getLocalAddress, getMaxTries, getMembers, getNumberOfHeartbeatsSent, getNumSuspectEventsGenerated, getPingableMembers, getPingDest, getPingDest, getTimeout, isMonitorRunning, printSuspectHistory, resetStats, sendHeartbeatResponse, setMaxTries, setTimeout, startFailureDetection, startMonitor, stop, stopFailureDetection, stopMonitor, unsuspect, updateTimestamp
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bind_interface_str

protected java.lang.String bind_interface_str

ttl

protected int ttl
Time-to-live for InetAddress.isReachable()

Constructor Detail

FD_ICMP

public FD_ICMP()
Method Detail

init

public void init()
          throws java.lang.Exception
Description copied from class: Protocol
Called after instance has been created (null constructor) and before protocol is started. Properties are already set. Other protocols are not yet connected and events cannot yet be sent.

Overrides:
init in class FD
Throws:
java.lang.Exception - Thrown if protocol cannot be initialized successfully. This will cause the ProtocolStack to fail, so the channel constructor will throw an exception

up

public java.lang.Object up(Event evt)
Description copied from class: Protocol
An event was received from the layer below. Usually the current layer will want to examine the event type and - depending on its type - perform some computation (e.g. removing headers from a MSG event type, or updating the internal membership list when receiving a VIEW_CHANGE event). Finally the event is either a) discarded, or b) an event is sent down the stack using down_prot.down() or c) the event (or another event) is sent up the stack using up_prot.up().

Overrides:
up in class FD

createMonitor

protected FD.Monitor createMonitor()


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.