org.apache.activemq.broker.region
Class IndirectMessageReference

java.lang.Object
  extended by org.apache.activemq.broker.region.IndirectMessageReference
All Implemented Interfaces:
MessageReference, QueueMessageReference

public class IndirectMessageReference
extends Object
implements QueueMessageReference

Keeps track of a message that is flowing through the Broker. This object may hold a hard reference to the message or only hold the id of the message if the message has been persisted on in a MessageStore.


Field Summary
 
Fields inherited from interface org.apache.activemq.broker.region.QueueMessageReference
NULL_MESSAGE
 
Constructor Summary
IndirectMessageReference(Message message)
           
 
Method Summary
 int decrementReferenceCount()
           
 void drop()
           
 long getExpiration()
           
 String getGroupID()
           
 int getGroupSequence()
           
 LockOwner getLockOwner()
           
 Message getMessage()
           
 Message getMessageHardRef()
           
 MessageId getMessageId()
           
 int getRedeliveryCounter()
           
 int getReferenceCount()
           
 Destination getRegionDestination()
           
 int getSize()
           
 ConsumerId getTargetConsumerId()
           
 void incrementRedeliveryCounter()
           
 int incrementReferenceCount()
           
 boolean isAcked()
           
 boolean isAdvisory()
           
 boolean isDropped()
          Returns true if this message is dropped.
 boolean isExpired()
          Returns true if this message is expired
 boolean isLocked()
           
 boolean isPersistent()
           
 boolean lock(LockOwner subscription)
           
 void setAcked(boolean b)
           
 String toString()
           
 boolean unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndirectMessageReference

public IndirectMessageReference(Message message)
Parameters:
message -
Method Detail

getMessageHardRef

public Message getMessageHardRef()
Specified by:
getMessageHardRef in interface MessageReference

getReferenceCount

public int getReferenceCount()
Specified by:
getReferenceCount in interface MessageReference

incrementReferenceCount

public int incrementReferenceCount()
Specified by:
incrementReferenceCount in interface MessageReference

decrementReferenceCount

public int decrementReferenceCount()
Specified by:
decrementReferenceCount in interface MessageReference

getMessage

public Message getMessage()
Specified by:
getMessage in interface MessageReference

toString

public String toString()
Overrides:
toString in class Object

incrementRedeliveryCounter

public void incrementRedeliveryCounter()
Specified by:
incrementRedeliveryCounter in interface MessageReference

isDropped

public boolean isDropped()
Description copied from interface: MessageReference
Returns true if this message is dropped.

Specified by:
isDropped in interface MessageReference
Specified by:
isDropped in interface QueueMessageReference

drop

public void drop()
Specified by:
drop in interface QueueMessageReference

lock

public boolean lock(LockOwner subscription)
Specified by:
lock in interface QueueMessageReference

unlock

public boolean unlock()
Specified by:
unlock in interface QueueMessageReference

getLockOwner

public LockOwner getLockOwner()
Specified by:
getLockOwner in interface QueueMessageReference

getRedeliveryCounter

public int getRedeliveryCounter()
Specified by:
getRedeliveryCounter in interface MessageReference

getMessageId

public MessageId getMessageId()
Specified by:
getMessageId in interface MessageReference

getRegionDestination

public Destination getRegionDestination()
Specified by:
getRegionDestination in interface MessageReference

isPersistent

public boolean isPersistent()
Specified by:
isPersistent in interface MessageReference

isLocked

public boolean isLocked()

isAcked

public boolean isAcked()
Specified by:
isAcked in interface QueueMessageReference

setAcked

public void setAcked(boolean b)
Specified by:
setAcked in interface QueueMessageReference

getGroupID

public String getGroupID()
Specified by:
getGroupID in interface MessageReference

getGroupSequence

public int getGroupSequence()
Specified by:
getGroupSequence in interface MessageReference

getTargetConsumerId

public ConsumerId getTargetConsumerId()
Specified by:
getTargetConsumerId in interface MessageReference

getExpiration

public long getExpiration()
Specified by:
getExpiration in interface MessageReference

isExpired

public boolean isExpired()
Description copied from interface: MessageReference
Returns true if this message is expired

Specified by:
isExpired in interface MessageReference

getSize

public int getSize()
Specified by:
getSize in interface MessageReference

isAdvisory

public boolean isAdvisory()
Specified by:
isAdvisory in interface MessageReference
Returns:
true if the message is an advisory


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