org.apache.activemq
Class ActiveMQMessageAuditNoSync

java.lang.Object
  extended by org.apache.activemq.ActiveMQMessageAuditNoSync
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ActiveMQMessageAudit

public class ActiveMQMessageAuditNoSync
extends Object
implements Serializable

Provides basic audit functions for Messages without sync

See Also:
Serialized Form

Field Summary
static int DEFAULT_WINDOW_SIZE
           
static int MAXIMUM_PRODUCER_COUNT
           
 
Constructor Summary
ActiveMQMessageAuditNoSync()
          Default Constructor windowSize = 2048, maximumNumberOfProducersToTrack = 64
ActiveMQMessageAuditNoSync(int auditDepth, int maximumNumberOfProducersToTrack)
          Construct a MessageAudit
 
Method Summary
 void clear()
           
 int getAuditDepth()
           
 long getLastSeqId(ProducerId id)
           
 int getMaximumNumberOfProducersToTrack()
           
 boolean isDuplicate(Message message)
          Checks if this message has been seen before
 boolean isDuplicate(MessageId id)
          Checks if this messageId has been seen before
 boolean isDuplicate(MessageReference message)
          Checks if this message has been seen before
 boolean isDuplicate(String id)
          checks whether this messageId has been seen before and adds this messageId to the list
 boolean isInOrder(Message msg)
          Check the message is in order
 boolean isInOrder(MessageId id)
          Check the MessageId is in order
 boolean isInOrder(MessageReference message)
          Check the MessageId is in order
 boolean isInOrder(String id)
          Check the message id is in order
 boolean isModified()
          Returns if the Audit has been modified since last check, this method does not reset the modified flag.
 boolean modified()
          Reads and returns the current modified state of the Audit, once called the state is reset to false.
 void rollback(MessageId id)
          mark this message as being received
 void rollback(MessageReference message)
          mark this message as being received
 void rollback(String id)
           
 void setAuditDepth(int auditDepth)
           
 void setMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack)
           
 void setModified(boolean modified)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WINDOW_SIZE

public static final int DEFAULT_WINDOW_SIZE
See Also:
Constant Field Values

MAXIMUM_PRODUCER_COUNT

public static final int MAXIMUM_PRODUCER_COUNT
See Also:
Constant Field Values
Constructor Detail

ActiveMQMessageAuditNoSync

public ActiveMQMessageAuditNoSync()
Default Constructor windowSize = 2048, maximumNumberOfProducersToTrack = 64


ActiveMQMessageAuditNoSync

public ActiveMQMessageAuditNoSync(int auditDepth,
                                  int maximumNumberOfProducersToTrack)
Construct a MessageAudit

Parameters:
auditDepth - range of ids to track
maximumNumberOfProducersToTrack - number of producers expected in the system
Method Detail

getAuditDepth

public int getAuditDepth()
Returns:
the auditDepth

setAuditDepth

public void setAuditDepth(int auditDepth)
Parameters:
auditDepth - the auditDepth to set

getMaximumNumberOfProducersToTrack

public int getMaximumNumberOfProducersToTrack()
Returns:
the maximumNumberOfProducersToTrack

setMaximumNumberOfProducersToTrack

public void setMaximumNumberOfProducersToTrack(int maximumNumberOfProducersToTrack)
Parameters:
maximumNumberOfProducersToTrack - the maximumNumberOfProducersToTrack to set

isDuplicate

public boolean isDuplicate(Message message)
                    throws JMSException
Checks if this message has been seen before

Parameters:
message -
Returns:
true if the message is a duplicate
Throws:
JMSException

isDuplicate

public boolean isDuplicate(String id)
checks whether this messageId has been seen before and adds this messageId to the list

Parameters:
id -
Returns:
true if the message is a duplicate

isDuplicate

public boolean isDuplicate(MessageReference message)
Checks if this message has been seen before

Parameters:
message -
Returns:
true if the message is a duplicate

isDuplicate

public boolean isDuplicate(MessageId id)
Checks if this messageId has been seen before

Parameters:
id -
Returns:
true if the message is a duplicate

rollback

public void rollback(MessageReference message)
mark this message as being received

Parameters:
message -

rollback

public void rollback(MessageId id)
mark this message as being received

Parameters:
id -

rollback

public void rollback(String id)

isInOrder

public boolean isInOrder(Message msg)
                  throws JMSException
Check the message is in order

Parameters:
msg -
Returns:
Throws:
JMSException

isInOrder

public boolean isInOrder(String id)
Check the message id is in order

Parameters:
id -
Returns:

isInOrder

public boolean isInOrder(MessageReference message)
Check the MessageId is in order

Parameters:
message -
Returns:

isInOrder

public boolean isInOrder(MessageId id)
Check the MessageId is in order

Parameters:
id -
Returns:

getLastSeqId

public long getLastSeqId(ProducerId id)

clear

public void clear()

isModified

public boolean isModified()
Returns if the Audit has been modified since last check, this method does not reset the modified flag. If the caller needs to reset the flag in order to avoid serializing an unchanged Audit then its up the them to reset it themselves.

Returns:
true if the Audit has been modified.

setModified

public void setModified(boolean modified)

modified

public boolean modified()
Reads and returns the current modified state of the Audit, once called the state is reset to false. This method is useful for code the needs to know if it should write out the Audit or otherwise execute some logic based on the Audit having changed since last check.

Returns:
true if the Audit has been modified since last check.


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.