Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jgroups.protocols
Class FD_SIMPLE  view FD_SIMPLE download FD_SIMPLE.java

java.lang.Object
  extended byorg.jgroups.stack.Protocol
      extended byorg.jgroups.protocols.FD_SIMPLE

public class FD_SIMPLE
extends org.jgroups.stack.Protocol

Simple failure detection protocol. Periodically sends a are-you-alive message to a randomly chosen member (excluding itself) and waits for a response. If a response has not been received within timeout msecs, a counter associated with that member will be incremented. If the counter exceeds max_missed_hbs, that member will be suspected. When a message or a heartbeat are received, the counter is reset to 0.

Version:
$Revision: 1.9 $

Nested Class Summary
static class FD_SIMPLE.FdHeader
           
(package private)  class FD_SIMPLE.HeartbeatTask
           
 
Field Summary
(package private)  java.util.HashMap counters
           
(package private)  long interval
           
(package private)  org.jgroups.Address local_addr
           
(package private)  int max_missed_hbs
           
(package private)  java.util.Vector members
           
(package private) static java.lang.String name
           
(package private)  FD_SIMPLE.HeartbeatTask task
           
(package private)  long timeout
           
(package private)  org.jgroups.util.TimeScheduler timer
           
 
Fields inherited from class org.jgroups.stack.Protocol
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
 
Constructor Summary
FD_SIMPLE()
           
 
Method Summary
 void down(org.jgroups.Event evt)
          An event is to be sent down the stack.
(package private)  org.jgroups.Address getHeartbeatDest()
           
 java.lang.String getName()
           
(package private)  int incrementCounter(org.jgroups.Address mbr)
           
 void init()
          Called after instance has been created (null constructor) and before protocol is started.
(package private)  java.lang.String printCounters()
           
(package private)  void resetCounter(org.jgroups.Address mbr)
           
 boolean setProperties(java.util.Properties props)
          Configures the protocol initially.
 void stop()
          This method is called on a Channel.disconnect()>Channel.disconnect() 55 .
 void up(org.jgroups.Event evt)
          An event was received from the layer below.
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, isTrace, isWarn, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setTrace, setUpProtocol, setWarn, start, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

local_addr

org.jgroups.Address local_addr

timer

org.jgroups.util.TimeScheduler timer

task

FD_SIMPLE.HeartbeatTask task

interval

long interval

timeout

long timeout

members

final java.util.Vector members

counters

final java.util.HashMap counters

max_missed_hbs

int max_missed_hbs

name

static final java.lang.String name
See Also:
Constant Field Values
Constructor Detail

FD_SIMPLE

public FD_SIMPLE()
Method Detail

getName

public java.lang.String getName()

init

public void init()
          throws java.lang.Exception
Description copied from class: org.jgroups.stack.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.


setProperties

public boolean setProperties(java.util.Properties props)
Description copied from class: org.jgroups.stack.Protocol
Configures the protocol initially. A configuration string consists of name=value items, separated by a ';' (semicolon), e.g.:
 "loopback=false;unicast_inport=4444"
 


stop

public void stop()
Description copied from class: org.jgroups.stack.Protocol
This method is called on a Channel.disconnect()>Channel.disconnect() 55 . 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


up

public void up(org.jgroups.Event evt)
Description copied from class: org.jgroups.stack.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().


down

public void down(org.jgroups.Event evt)
Description copied from class: org.jgroups.stack.Protocol
An event is to be sent down the stack. The layer may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the layer may need to add a header to it (or do nothing at all) before sending it down the stack using passDown(). In case of a GET_ADDRESS event (which tries to retrieve the stack's address from one of the bottom layers), the layer may need to send a new response event back up the stack using passUp().


getHeartbeatDest

org.jgroups.Address getHeartbeatDest()

incrementCounter

int incrementCounter(org.jgroups.Address mbr)

resetCounter

void resetCounter(org.jgroups.Address mbr)

printCounters

java.lang.String printCounters()