Class DefaultReplayStrategy
java.lang.Object
org.apache.activemq.transport.reliable.DefaultReplayStrategy
- All Implemented Interfaces:
ReplayStrategy
Throws an exception if packets are dropped causing the transport to be
closed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanonDroppedPackets(ReliableTransport transport, int expectedCounter, int actualCounter, int nextAvailableCounter) Deals with a dropped packet.voidonReceivedPacket(ReliableTransport transport, long expectedCounter) voidsetMaximumDifference(int maximumDifference) Sets the maximum allowed difference between an expected packet and an actual packet before an error occurs
-
Constructor Details
-
DefaultReplayStrategy
public DefaultReplayStrategy() -
DefaultReplayStrategy
public DefaultReplayStrategy(int maximumDifference)
-
-
Method Details
-
onDroppedPackets
public boolean onDroppedPackets(ReliableTransport transport, int expectedCounter, int actualCounter, int nextAvailableCounter) throws IOException Description copied from interface:ReplayStrategyDeals with a dropped packet.- Specified by:
onDroppedPacketsin interfaceReplayStrategy- Parameters:
transport- the transport on which the packet was droppedexpectedCounter- the expected command counteractualCounter- the actual command counternextAvailableCounter- TODO- Returns:
- true if the command should be buffered or false if it should be discarded
- Throws:
IOException
-
onReceivedPacket
- Specified by:
onReceivedPacketin interfaceReplayStrategy
-
getMaximumDifference
public int getMaximumDifference() -
setMaximumDifference
public void setMaximumDifference(int maximumDifference) Sets the maximum allowed difference between an expected packet and an actual packet before an error occurs
-