public class NAKACK extends Protocol implements Retransmitter.RetransmitCommand, NakReceiverWindow.Listener
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
Constructor and Description |
---|
NAKACK() |
Modifier and Type | Method and Description |
---|---|
void |
down(Event evt)
Callback.
|
java.util.Map |
dumpStats() |
int |
getGcLag() |
int |
getMaxXmitBufSize() |
long |
getMaxXmitSize() |
long |
getMissingMessagesReceived() |
java.lang.String |
getName() |
int |
getPendingRetransmissionRequests() |
int |
getReceivedTableSize() |
int |
getSentTableSize() |
long |
getXmitRequestsReceived() |
long |
getXmitRequestsSent() |
long |
getXmitResponsesReceived() |
long |
getXmitResponsesSent() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
boolean |
isDiscardDeliveredMsgs() |
boolean |
isUseMcastXmit() |
boolean |
isXmitFromRandomMember() |
void |
missingMessageReceived(long seqno,
Message msg) |
java.lang.String |
printMessages() |
java.lang.String |
printSentMsgs() |
java.lang.String |
printStats() |
java.util.Vector |
providedDownServices()
List of events that are provided to layers below (they will be handled when sent down from
below).
|
java.util.Vector |
providedUpServices()
List of events that are provided to layers above (they will be handled when sent down from
above).
|
void |
resetStats() |
void |
retransmit(long first_seqno,
long last_seqno,
Address sender)
Implementation of Retransmitter.RetransmitCommand.
|
void |
setDiscardDeliveredMsgs(boolean discard_delivered_msgs) |
void |
setGcLag(int gc_lag) |
void |
setMaxXmitBufSize(int max_xmit_buf_size) |
void |
setMaxXmitSize(long max_xmit_size) |
boolean |
setProperties(java.util.Properties props)
Configures the protocol initially.
|
void |
setUseMcastXmit(boolean use_mcast_xmit) |
void |
setXmitFromRandomMember(boolean xmit_from_random_member) |
void |
start()
This method is called on a
Channel.connect(String) . |
void |
stop()
This method is called on a
Channel.disconnect() . |
void |
up(Event evt)
Callback.
|
destroy, downThreadEnabled, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, passDown, passUp, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, startDownHandler, startUpHandler, statsEnabled, stopInternal, upThreadEnabled
public long getXmitRequestsReceived()
public long getXmitRequestsSent()
public long getXmitResponsesReceived()
public long getXmitResponsesSent()
public long getMissingMessagesReceived()
public int getPendingRetransmissionRequests()
public int getSentTableSize()
public int getReceivedTableSize()
public void resetStats()
resetStats
in class Protocol
public void init() throws java.lang.Exception
Protocol
public int getGcLag()
public void setGcLag(int gc_lag)
public boolean isUseMcastXmit()
public void setUseMcastXmit(boolean use_mcast_xmit)
public boolean isXmitFromRandomMember()
public void setXmitFromRandomMember(boolean xmit_from_random_member)
public boolean isDiscardDeliveredMsgs()
public void setDiscardDeliveredMsgs(boolean discard_delivered_msgs)
public int getMaxXmitBufSize()
public void setMaxXmitBufSize(int max_xmit_buf_size)
public long getMaxXmitSize()
public void setMaxXmitSize(long max_xmit_size)
public boolean setProperties(java.util.Properties props)
Protocol
"loopback=false;unicast_inport=4444"
setProperties
in class Protocol
public java.lang.String printStats()
printStats
in class Protocol
public java.util.Vector providedUpServices()
Protocol
providedUpServices
in class Protocol
public java.util.Vector providedDownServices()
Protocol
providedDownServices
in class Protocol
public void start() throws java.lang.Exception
Protocol
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.start
in class Protocol
java.lang.Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String)
will throw an exceptionpublic void stop()
Protocol
Channel.disconnect()
. 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 flushedpublic void down(Event evt)
Do not use passDown()
in this
method as the event is passed down by default by the superclass after this method returns !
public void up(Event evt)
Do not use PassUp
in this
method as the event is passed up by default by the superclass after this method returns !
public void retransmit(long first_seqno, long last_seqno, Address sender)
retransmit
in interface Retransmitter.RetransmitCommand
first_seqno
- The sequence number of the first missing messagelast_seqno
- The sequence number of the last missing messagesender
- The destination of the member to which the retransmit request will be sent
(nak-based scheme), or to which the message will be retransmitted (ack-based scheme).public void missingMessageReceived(long seqno, Message msg)
missingMessageReceived
in interface NakReceiverWindow.Listener
public java.lang.String printMessages()
public java.lang.String printSentMsgs()
Copyright ? 1998-2006 Bela Ban. All Rights Reserved.