fulmine.distribution
Interface IHeartbeatMonitor

All Known Subinterfaces:
IConnectionDiscoverer, INetwork
All Known Implementing Classes:
AbstractConnectionDiscoverer, FTTcpNetwork, TcpConnectionDiscoverer, TcpNetwork

public interface IHeartbeatMonitor

Encapsulates operations for setting network heartbeat parameters.

Author:
Ramon Servadei

Field Summary
static int DEFAULT_ALLOWED_MISSED_COUNT
          The default number of allowed missed heartbeats
static long DEFAULT_HEARTBEAT_PERIOD
          The default heartbeat period
 
Method Summary
 int getAllowableNetworkHeartbeatMissCount()
          Get the number of allowed missed heartbeats before a remote context is deemed to be not available.
 long getNetworkHeartbeatPeriod()
          Get the heartbeat period in milliseconds.
 void setAllowableNetworkHeartbeatMissCount(int allowedHeartbeatMissCount)
          Set the allowable number of missed heartbeats from other contexts on the network before that context is deemed to be not available anymore.
 void setNetworkHeartbeatPeriod(long periodInMillis)
          Set the network heartbeat period.
 

Field Detail

DEFAULT_HEARTBEAT_PERIOD

static final long DEFAULT_HEARTBEAT_PERIOD
The default heartbeat period

See Also:
Constant Field Values

DEFAULT_ALLOWED_MISSED_COUNT

static final int DEFAULT_ALLOWED_MISSED_COUNT
The default number of allowed missed heartbeats

See Also:
Constant Field Values
Method Detail

setNetworkHeartbeatPeriod

void setNetworkHeartbeatPeriod(long periodInMillis)
Set the network heartbeat period. This local context will send out a heartbeat ping message onto the network at this rate.

As a general rule-of-thumb, the heartbeat period should be small and the allowed heartbeat miss count high. This provides more leniency for not cancelling a context if heartbeats are missed.

Parameters:
periodInMillis - the heartbeat period in milliseconds

setAllowableNetworkHeartbeatMissCount

void setAllowableNetworkHeartbeatMissCount(int allowedHeartbeatMissCount)
Set the allowable number of missed heartbeats from other contexts on the network before that context is deemed to be not available anymore.

Parameters:
allowedHeartbeatMissCount - the number of missed heartbeats allowed before a remote context is deemed to be not available
See Also:
setNetworkHeartbeatPeriod(long)

getNetworkHeartbeatPeriod

long getNetworkHeartbeatPeriod()
Get the heartbeat period in milliseconds.

Returns:
the heartbeat period in milliseconds

getAllowableNetworkHeartbeatMissCount

int getAllowableNetworkHeartbeatMissCount()
Get the number of allowed missed heartbeats before a remote context is deemed to be not available.

Returns:
the number of missed heartbeats allowed before a remote context is deemed to be not available


Copyright © 2007-2009. All Rights Reserved.