Class IndirectMessageReference
- java.lang.Object
-
- org.apache.activemq.broker.region.IndirectMessageReference
-
- All Implemented Interfaces:
org.apache.activemq.broker.region.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(org.apache.activemq.command.Message message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canProcessAsExpired()
int
decrementReferenceCount()
void
drop()
boolean
dropIfLive()
Check if the message has already been dropped before dropping.long
getExpiration()
String
getGroupID()
int
getGroupSequence()
LockOwner
getLockOwner()
org.apache.activemq.command.Message
getMessage()
org.apache.activemq.command.Message
getMessageHardRef()
org.apache.activemq.command.MessageId
getMessageId()
int
getRedeliveryCounter()
int
getReferenceCount()
org.apache.activemq.command.Message.MessageDestination
getRegionDestination()
int
getSize()
org.apache.activemq.command.ConsumerId
getTargetConsumerId()
void
incrementRedeliveryCounter()
int
incrementReferenceCount()
boolean
isAcked()
boolean
isAdvisory()
boolean
isDropped()
boolean
isExpired()
boolean
isLocked()
boolean
isPersistent()
boolean
lock(LockOwner subscription)
void
setAcked(boolean b)
String
toString()
boolean
unlock()
-
-
-
Method Detail
-
getMessageHardRef
public org.apache.activemq.command.Message getMessageHardRef()
- Specified by:
getMessageHardRef
in interfaceorg.apache.activemq.broker.region.MessageReference
-
getReferenceCount
public int getReferenceCount()
- Specified by:
getReferenceCount
in interfaceorg.apache.activemq.broker.region.MessageReference
-
incrementReferenceCount
public int incrementReferenceCount()
- Specified by:
incrementReferenceCount
in interfaceorg.apache.activemq.broker.region.MessageReference
-
decrementReferenceCount
public int decrementReferenceCount()
- Specified by:
decrementReferenceCount
in interfaceorg.apache.activemq.broker.region.MessageReference
-
getMessage
public org.apache.activemq.command.Message getMessage()
- Specified by:
getMessage
in interfaceorg.apache.activemq.broker.region.MessageReference
-
incrementRedeliveryCounter
public void incrementRedeliveryCounter()
- Specified by:
incrementRedeliveryCounter
in interfaceorg.apache.activemq.broker.region.MessageReference
-
isDropped
public boolean isDropped()
- Specified by:
isDropped
in interfaceorg.apache.activemq.broker.region.MessageReference
- Specified by:
isDropped
in interfaceQueueMessageReference
-
drop
public void drop()
- Specified by:
drop
in 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:
dropIfLive
in interfaceQueueMessageReference
-
lock
public boolean lock(LockOwner subscription)
- Specified by:
lock
in interfaceQueueMessageReference
-
unlock
public boolean unlock()
- Specified by:
unlock
in interfaceQueueMessageReference
-
getLockOwner
public LockOwner getLockOwner()
- Specified by:
getLockOwner
in interfaceQueueMessageReference
-
getRedeliveryCounter
public int getRedeliveryCounter()
- Specified by:
getRedeliveryCounter
in interfaceorg.apache.activemq.broker.region.MessageReference
-
getMessageId
public org.apache.activemq.command.MessageId getMessageId()
- Specified by:
getMessageId
in interfaceorg.apache.activemq.broker.region.MessageReference
-
getRegionDestination
public org.apache.activemq.command.Message.MessageDestination getRegionDestination()
- Specified by:
getRegionDestination
in interfaceorg.apache.activemq.broker.region.MessageReference
-
isPersistent
public boolean isPersistent()
- Specified by:
isPersistent
in interfaceorg.apache.activemq.broker.region.MessageReference
-
isLocked
public boolean isLocked()
-
isAcked
public boolean isAcked()
- Specified by:
isAcked
in interfaceQueueMessageReference
-
setAcked
public void setAcked(boolean b)
- Specified by:
setAcked
in interfaceQueueMessageReference
-
getGroupID
public String getGroupID()
- Specified by:
getGroupID
in interfaceorg.apache.activemq.broker.region.MessageReference
-
getGroupSequence
public int getGroupSequence()
- Specified by:
getGroupSequence
in interfaceorg.apache.activemq.broker.region.MessageReference
-
getTargetConsumerId
public org.apache.activemq.command.ConsumerId getTargetConsumerId()
- Specified by:
getTargetConsumerId
in interfaceorg.apache.activemq.broker.region.MessageReference
-
getExpiration
public long getExpiration()
- Specified by:
getExpiration
in interfaceorg.apache.activemq.broker.region.MessageReference
-
isExpired
public boolean isExpired()
- Specified by:
isExpired
in interfaceorg.apache.activemq.broker.region.MessageReference
-
getSize
public int getSize()
- Specified by:
getSize
in interfaceorg.apache.activemq.broker.region.MessageReference
-
isAdvisory
public boolean isAdvisory()
- Specified by:
isAdvisory
in interfaceorg.apache.activemq.broker.region.MessageReference
-
canProcessAsExpired
public boolean canProcessAsExpired()
- Specified by:
canProcessAsExpired
in interfaceorg.apache.activemq.broker.region.MessageReference
-
-