Package org.objectweb.joram.mom.util
Class DMQManager
- java.lang.Object
-
- org.objectweb.joram.mom.util.DMQManager
-
public class DMQManager extends Object
TheDMQManageris made to stock the dead messages before sending them to the dead message queue, only if such a queue is defined.
-
-
Field Summary
Fields Modifier and Type Field Description private ClientMessagesdeadMessagesprivate static booleanDEBUGprivate AgentIddestDmqIdprivate static Loggerloggerprivate AgentIdsenderId
-
Constructor Summary
Constructors Constructor Description DMQManager(AgentId currentDestDmq, AgentId senderId)Creates a DMQManager.DMQManager(AgentId specificDmq, AgentId currentDestDmq, AgentId senderId)Creates a DMQManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDeadMessage(Message mess, short reason)Stocks a dead message waiting to be sent to the DMQ.voidsendToDMQ()Sends previously stocked messages to the appropriate DMQ.
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
deadMessages
private ClientMessages deadMessages
-
destDmqId
private AgentId destDmqId
-
senderId
private AgentId senderId
-
-
Constructor Detail
-
DMQManager
public DMQManager(AgentId specificDmq, AgentId currentDestDmq, AgentId senderId)
Creates a DMQManager. ThespecificDmqis used in priority. Ifnull, destination DMQ is used if it exists, else default DMQ is used. If none exists, dead messages will be lost.- Parameters:
specificDmq- Identifier of the dead message queue to use in priority.currentDestDmq- The DMQ of the destinationsenderId- The id of the destination. This is used to avoid sending to itself.
-
DMQManager
public DMQManager(AgentId currentDestDmq, AgentId senderId)
Creates a DMQManager. Destination DMQ is used if it exists, else default DMQ is used. If none exists, dead messages will be lost- Parameters:
currentDestDmq- The DMQ of the destinationsenderId- The id of the destination. This is used to avoid sending to itself.
-
-
Method Detail
-
addDeadMessage
public void addDeadMessage(Message mess, short reason)
Stocks a dead message waiting to be sent to the DMQ. If no DMQ was found at creation time, the message is lost.- Parameters:
mess- The message to stockreason- The reason explaining why the message has to be send to the DMQ. It can be one of the following:EXPIRED,NOT_WRITEABLE,UNDELIVERABLE,ADMIN_DELETED,DELETED_DEST,QUEUE_FULLorUNEXPECTED_ERROR.
-
sendToDMQ
public void sendToDMQ()
Sends previously stocked messages to the appropriate DMQ.
-
-