edu.nyu.cs.pdsg.switchboard.liveness
Class SbLivenessLayer

java.lang.Object
  extended byedu.nyu.cs.pdsg.switchboard.SbStatus
      extended byedu.nyu.cs.pdsg.switchboard.SbLayer
          extended byedu.nyu.cs.pdsg.switchboard.liveness.SbLivenessLayer
All Implemented Interfaces:
java.lang.Runnable, SbAsyncTransportClient, SbAsyncTransportProvider, SbAsyncTransportRecipient, SbClient, SbLayerable, SbProvider

public class SbLivenessLayer
extends SbLayer
implements java.lang.Runnable


Nested Class Summary
(package private)  class SbLivenessLayer.LivenessTimer
           
 
Field Summary
(package private)  long computedPollInterval
           
(package private)  long firstSendAfterReceiveTime
           
(package private)  long initializeBeginTime
           
(package private)  long initializeCompleteLimit
           
(package private)  long lastArriveTime
           
(package private)  SbLivenessMessage lastReceivedMessage
           
(package private)  long lastSendTime
           
(package private)  SbLivenessParams measuredVals
           
(package private)  SbLivenessParams mergedParams
           
(package private)  long nextReceiveByTime
           
(package private)  long nextSendByTime
           
(package private)  SbLivenessParams partnerParams
           
(package private)  SbLivenessParams requestedParams
           
(package private)  int state
           
(package private)  int STATE_INITIALIZING
           
(package private)  int STATE_LIVE
           
(package private)  int STATE_UNSTARTED
           
(package private)  SbLivenessLayer.LivenessTimer timer
           
 
Fields inherited from class edu.nyu.cs.pdsg.switchboard.SbLayer
client, createStackTrace, eventHandler, provider, recipient
 
Fields inherited from class edu.nyu.cs.pdsg.switchboard.SbStatus
STATUS_CLOSED, STATUS_LIVE, STATUS_PARTNER_CLOSED, STATUS_RECOVERABLE, STATUS_UNRECOVERABLE
 
Constructor Summary
SbLivenessLayer(SbAsyncTransportProvider _below, SbLivenessParams requestedParams)
           
SbLivenessLayer(SbLayer _below)
           
SbLivenessLayer(SbLayer _below, long limit)
           
 
Method Summary
 void _close()
          Closes this layer and all layers underneath it.
private  long adj(long ms)
           
(package private)  void checkLiveness()
           
 void deliver(java.lang.Object obj)
          Defines the behavior how to deliver an Object to the layer above.
 java.lang.String getLayerType()
           
 SbLivenessParams getMeasuredVals()
           
 SbLivenessParams getParams()
           
 SbLivenessParams getPartnerParams()
           
(package private)  long getTime()
           
 void handleEvent(SbLayer layer)
           
 void init()
          Run all initialization code.
(package private) static long max(long a, long b)
           
(package private) static long min(long a, long b)
           
 void providerReady()
          called when provider is ready
(package private)  void recomputeParams()
           
 void run()
           
(package private)  void scheduleBy(long when)
           
 void sendDownLivenessMessage(SbLivenessMessage msg)
           
 void setParams(SbLivenessParams _requestedParams)
           
 void write(java.lang.Object obj)
          Defines the behavior how to deliver an Object to the layer above.
 
Methods inherited from class edu.nyu.cs.pdsg.switchboard.SbLayer
behavesLike, close, closeQuiet, finalize, find, getProviderException, getProviderStackTrace, getProviderStatus, getTransportName, handleEvent, handleEvent, instanceOf, isKindOf, isOpen, isReady, providerStatusString, recipientReady, sendDown, sendUp, serialize, setClient, setEventHandler, setProvider, setProviderStatus, setProviderStatus, setProviderStatusSend, setRecipient, toShortString, toString, unserialize
 
Methods inherited from class edu.nyu.cs.pdsg.switchboard.SbStatus
statusString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timer

SbLivenessLayer.LivenessTimer timer

initializeBeginTime

long initializeBeginTime

computedPollInterval

long computedPollInterval

nextSendByTime

long nextSendByTime

nextReceiveByTime

long nextReceiveByTime

initializeCompleteLimit

long initializeCompleteLimit

STATE_UNSTARTED

final int STATE_UNSTARTED
See Also:
Constant Field Values

STATE_INITIALIZING

final int STATE_INITIALIZING
See Also:
Constant Field Values

STATE_LIVE

final int STATE_LIVE
See Also:
Constant Field Values

state

int state

lastReceivedMessage

SbLivenessMessage lastReceivedMessage

lastSendTime

long lastSendTime

lastArriveTime

long lastArriveTime

firstSendAfterReceiveTime

long firstSendAfterReceiveTime

mergedParams

SbLivenessParams mergedParams

measuredVals

SbLivenessParams measuredVals

requestedParams

SbLivenessParams requestedParams

partnerParams

SbLivenessParams partnerParams
Constructor Detail

SbLivenessLayer

public SbLivenessLayer(SbAsyncTransportProvider _below,
                       SbLivenessParams requestedParams)

SbLivenessLayer

public SbLivenessLayer(SbLayer _below,
                       long limit)

SbLivenessLayer

public SbLivenessLayer(SbLayer _below)
Method Detail

deliver

public void deliver(java.lang.Object obj)
Description copied from interface: SbAsyncTransportRecipient
Defines the behavior how to deliver an Object to the layer above.

Specified by:
deliver in interface SbAsyncTransportRecipient
Overrides:
deliver in class SbLayer

providerReady

public void providerReady()
Description copied from interface: SbClient
called when provider is ready

Specified by:
providerReady in interface SbClient
Overrides:
providerReady in class SbLayer

sendDownLivenessMessage

public void sendDownLivenessMessage(SbLivenessMessage msg)

write

public void write(java.lang.Object obj)
Description copied from interface: SbAsyncTransportProvider
Defines the behavior how to deliver an Object to the layer above.

Specified by:
write in interface SbAsyncTransportProvider
Overrides:
write in class SbLayer

setParams

public void setParams(SbLivenessParams _requestedParams)

recomputeParams

void recomputeParams()

min

static long min(long a,
                long b)

max

static long max(long a,
                long b)

getParams

public SbLivenessParams getParams()

getMeasuredVals

public SbLivenessParams getMeasuredVals()

getPartnerParams

public SbLivenessParams getPartnerParams()

checkLiveness

void checkLiveness()

run

public void run()
Specified by:
run in interface java.lang.Runnable

handleEvent

public void handleEvent(SbLayer layer)

init

public void init()
Description copied from class: SbLayer
Run all initialization code. No messages should be sent prior to init() being called. Don't call lower layer until ready to receive messages.

Specified by:
init in interface SbProvider
Overrides:
init in class SbLayer

getTime

long getTime()

_close

public void _close()
Description copied from class: SbLayer
Closes this layer and all layers underneath it.

Overrides:
_close in class SbLayer

scheduleBy

void scheduleBy(long when)

adj

private long adj(long ms)

getLayerType

public java.lang.String getLayerType()
Overrides:
getLayerType in class SbLayer


Copyright (c) 2002-2003 New York University RLAB