Class IndirectMessageReference
- java.lang.Object
-
- 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
Constructors Constructor Description IndirectMessageReference(Message message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanProcessAsExpired()intdecrementReferenceCount()voiddrop()booleandropIfLive()Check if the message has already been dropped before dropping.longgetExpiration()StringgetGroupID()intgetGroupSequence()LockOwnergetLockOwner()MessagegetMessage()MessagegetMessageHardRef()MessageIdgetMessageId()intgetRedeliveryCounter()intgetReferenceCount()Message.MessageDestinationgetRegionDestination()intgetSize()ConsumerIdgetTargetConsumerId()voidincrementRedeliveryCounter()intincrementReferenceCount()booleanisAcked()booleanisAdvisory()booleanisDropped()Returns true if this message is dropped.booleanisExpired()Returns true if this message is expiredbooleanisLocked()booleanisPersistent()booleanlock(LockOwner subscription)voidsetAcked(boolean b)StringtoString()booleanunlock()
-
-
-
Constructor Detail
-
IndirectMessageReference
public IndirectMessageReference(Message message)
- Parameters:
message-
-
-
Method Detail
-
getMessageHardRef
public Message getMessageHardRef()
- Specified by:
getMessageHardRefin interfaceMessageReference
-
getReferenceCount
public int getReferenceCount()
- Specified by:
getReferenceCountin interfaceMessageReference
-
incrementReferenceCount
public int incrementReferenceCount()
- Specified by:
incrementReferenceCountin interfaceMessageReference
-
decrementReferenceCount
public int decrementReferenceCount()
- Specified by:
decrementReferenceCountin interfaceMessageReference
-
getMessage
public Message getMessage()
- Specified by:
getMessagein interfaceMessageReference
-
incrementRedeliveryCounter
public void incrementRedeliveryCounter()
- Specified by:
incrementRedeliveryCounterin interfaceMessageReference
-
isDropped
public boolean isDropped()
Description copied from interface:MessageReferenceReturns true if this message is dropped.- Specified by:
isDroppedin interfaceMessageReference- Specified by:
isDroppedin interfaceQueueMessageReference
-
drop
public void drop()
- Specified by:
dropin interfaceQueueMessageReference
-
dropIfLive
public boolean dropIfLive()
Check if the message has already been dropped before dropping. Return true if dropped, else false. This method exists so that this can be done atomically under the intrinisic lock- Specified by:
dropIfLivein interfaceQueueMessageReference
-
lock
public boolean lock(LockOwner subscription)
- Specified by:
lockin interfaceQueueMessageReference
-
unlock
public boolean unlock()
- Specified by:
unlockin interfaceQueueMessageReference
-
getLockOwner
public LockOwner getLockOwner()
- Specified by:
getLockOwnerin interfaceQueueMessageReference
-
getRedeliveryCounter
public int getRedeliveryCounter()
- Specified by:
getRedeliveryCounterin interfaceMessageReference
-
getMessageId
public MessageId getMessageId()
- Specified by:
getMessageIdin interfaceMessageReference
-
getRegionDestination
public Message.MessageDestination getRegionDestination()
- Specified by:
getRegionDestinationin interfaceMessageReference
-
isPersistent
public boolean isPersistent()
- Specified by:
isPersistentin interfaceMessageReference
-
isLocked
public boolean isLocked()
-
isAcked
public boolean isAcked()
- Specified by:
isAckedin interfaceQueueMessageReference
-
setAcked
public void setAcked(boolean b)
- Specified by:
setAckedin interfaceQueueMessageReference
-
getGroupID
public String getGroupID()
- Specified by:
getGroupIDin interfaceMessageReference
-
getGroupSequence
public int getGroupSequence()
- Specified by:
getGroupSequencein interfaceMessageReference
-
getTargetConsumerId
public ConsumerId getTargetConsumerId()
- Specified by:
getTargetConsumerIdin interfaceMessageReference
-
getExpiration
public long getExpiration()
- Specified by:
getExpirationin interfaceMessageReference
-
isExpired
public boolean isExpired()
Description copied from interface:MessageReferenceReturns true if this message is expired- Specified by:
isExpiredin interfaceMessageReference
-
getSize
public int getSize()
- Specified by:
getSizein interfaceMessageReference
-
isAdvisory
public boolean isAdvisory()
- Specified by:
isAdvisoryin interfaceMessageReference- Returns:
- true if the message is an advisory
-
canProcessAsExpired
public boolean canProcessAsExpired()
- Specified by:
canProcessAsExpiredin interfaceMessageReference
-
-