org.apache.activemq.transport.reliable
Class ExceptionIfDroppedReplayStrategy

java.lang.Object
  extended by org.apache.activemq.transport.reliable.ExceptionIfDroppedReplayStrategy
All Implemented Interfaces:
ReplayStrategy

public class ExceptionIfDroppedReplayStrategy
extends java.lang.Object
implements ReplayStrategy

Throws an exception if packets are dropped causing the transport to be closed.


Constructor Summary
ExceptionIfDroppedReplayStrategy()
           
ExceptionIfDroppedReplayStrategy(int maximumDifference)
           
 
Method Summary
 int getMaximumDifference()
           
 boolean onDroppedPackets(ReliableTransport transport, int expectedCounter, int actualCounter, int nextAvailableCounter)
          Deals with a dropped packet.
 void onReceivedPacket(ReliableTransport transport, long expectedCounter)
           
 void setMaximumDifference(int maximumDifference)
          Sets the maximum allowed difference between an expected packet and an actual packet before an error occurs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionIfDroppedReplayStrategy

public ExceptionIfDroppedReplayStrategy()

ExceptionIfDroppedReplayStrategy

public ExceptionIfDroppedReplayStrategy(int maximumDifference)
Method Detail

onDroppedPackets

public boolean onDroppedPackets(ReliableTransport transport,
                                int expectedCounter,
                                int actualCounter,
                                int nextAvailableCounter)
                         throws java.io.IOException
Description copied from interface: ReplayStrategy
Deals with a dropped packet.

Specified by:
onDroppedPackets in interface ReplayStrategy
Parameters:
transport - the transport on which the packet was dropped
expectedCounter - the expected command counter
actualCounter - the actual command counter
nextAvailableCounter - TODO
Returns:
true if the command should be buffered or false if it should be discarded
Throws:
java.io.IOException

onReceivedPacket

public void onReceivedPacket(ReliableTransport transport,
                             long expectedCounter)
Specified by:
onReceivedPacket in interface ReplayStrategy

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



Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.