org.jgroups.protocols
Class FD_ICMP
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.FD
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 JDK 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 obviously done in JDK 5, so unless an echo service is configured to run, this
won't work...
- Version:
- $Id: FD_ICMP.java,v 1.5.2.1 2007/04/27 08:03:51 belaban Exp $
- Author:
- Bela Ban
Fields inherited from class org.jgroups.stack.Protocol |
down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, up_handler, up_prot, up_queue, up_thread, up_thread_prio |
Method Summary |
protected FD.Monitor |
createMonitor()
|
java.lang.String |
getName()
|
void |
init()
Called after instance has been created (null constructor) and before protocol is started. |
boolean |
setProperties(java.util.Properties props)
Configures the protocol initially. |
void |
up(Event evt)
An event was received from the layer below. |
Methods inherited from class org.jgroups.protocols.FD |
down, getCurrentNumTries, getLocalAddress, getMaxTries, getMembers, getNumberOfHeartbeatsSent, getNumSuspectEventsGenerated, getPingableMembers, getPingDest, getTimeout, isShun, printSuspectHistory, resetStats, setMaxTries, setShun, setTimeout, stop |
Methods inherited from class org.jgroups.stack.Protocol |
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, start, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabled |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FD_ICMP
public FD_ICMP()
getName
public java.lang.String getName()
- Overrides:
getName
in class FD
setProperties
public boolean setProperties(java.util.Properties props)
- Description copied from class:
Protocol
- Configures the protocol initially. A configuration string consists of name=value
items, separated by a ';' (semicolon), e.g.:
"loopback=false;unicast_inport=4444"
- Overrides:
setProperties
in class FD
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 void 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
passDown()
or c) the event (or another event) is sent up
the stack using passUp()
.
- Overrides:
up
in class FD
createMonitor
protected FD.Monitor createMonitor()
- Overrides:
createMonitor
in class FD
Copyright ? 1998-2006 Bela Ban. All Rights Reserved.