org.activemq.service
Class DeadLetterPolicy

java.lang.Object
  extended by org.activemq.service.DeadLetterPolicy

public class DeadLetterPolicy
extends Object

Determines how messages are stored in a dead letter queue

Version:
$Revision: 1.1.1.1 $

Field Summary
static String DEAD_LETTER_PREFIX
          Prefix used by dead letter queues
 
Constructor Summary
DeadLetterPolicy()
          Default constructor
DeadLetterPolicy(Broker broker)
          Construct a dead letter policy
DeadLetterPolicy(BrokerContainer brokerContainer)
           
 
Method Summary
protected  ActiveMQMessage createDeadLetterMessage(String dlqName, ActiveMQMessage message)
           
 Broker getBroker()
           
 String getDeadLetterName()
           
 String getDeadLetterNameFromDestination(ActiveMQDestination destination)
          Get the name of the DLQ from the destination provided
 String getDeadLetterPrefix()
           
 boolean isAllowDuplicates()
           
 boolean isDeadLetterEnabled()
           
 boolean isDeadLetterPerDestinationName()
           
 boolean isNoTopicConsumerEnabled()
           
 boolean isStoreNonPersistentMessages()
           
 boolean isUseDatabaseLocking()
           
 void sendToDeadLetter(ActiveMQMessage message)
          Send a message to a dead letter queue
 void setAllowDuplicates(boolean allowDuplicates)
           
 void setBroker(Broker broker)
           
 void setDeadLetterEnabled(boolean deadLetterEnabled)
           
 void setDeadLetterName(String deadLetterName)
           
 void setDeadLetterPerDestinationName(boolean deadLetterPerDestinationName)
           
 void setDeadLetterPrefix(String deadLetterPrefix)
           
 void setDeadLetterQueueTTL(long deadLetterQueueTTL)
           
 void setDeadLetterTopicTTL(long deadLetterTopicTTL)
           
 void setNoTopicConsumerEnabled(boolean noTopicConsumerEnabled)
           
 void setStoreNonPersistentMessages(boolean storeNonPersistentMessages)
           
 void setUseDatabaseLocking(boolean useDatabaseLocking)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEAD_LETTER_PREFIX

public static final String DEAD_LETTER_PREFIX
Prefix used by dead letter queues

See Also:
Constant Field Values
Constructor Detail

DeadLetterPolicy

public DeadLetterPolicy(Broker broker)
Construct a dead letter policy

Parameters:
broker -

DeadLetterPolicy

public DeadLetterPolicy(BrokerContainer brokerContainer)

DeadLetterPolicy

public DeadLetterPolicy()
Default constructor

Method Detail

getBroker

public Broker getBroker()
Returns:
Returns the broker.

setBroker

public void setBroker(Broker broker)
Parameters:
broker - The broker to set.

isDeadLetterEnabled

public boolean isDeadLetterEnabled()
Returns:
Returns the deadLetterEnabled.

setDeadLetterEnabled

public void setDeadLetterEnabled(boolean deadLetterEnabled)
Parameters:
deadLetterEnabled - The deadLetterEnabled to set.

isDeadLetterPerDestinationName

public boolean isDeadLetterPerDestinationName()
Returns:
Returns the deadLetterPerDestinationName.

setDeadLetterPerDestinationName

public void setDeadLetterPerDestinationName(boolean deadLetterPerDestinationName)
Parameters:
deadLetterPerDestinationName - The deadLetterPerDestinationName to set.

getDeadLetterName

public String getDeadLetterName()
Returns:
Returns the deadLetterName.

setDeadLetterName

public void setDeadLetterName(String deadLetterName)
Parameters:
deadLetterName - The deadLetterName to set.

getDeadLetterPrefix

public String getDeadLetterPrefix()
Returns:
Returns the deadLetterPrefix.

setDeadLetterPrefix

public void setDeadLetterPrefix(String deadLetterPrefix)
Parameters:
deadLetterPrefix - The deadLetterPrefix to set.

isStoreNonPersistentMessages

public boolean isStoreNonPersistentMessages()
Returns:
Returns the storeNonPersistentMessages.

setStoreNonPersistentMessages

public void setStoreNonPersistentMessages(boolean storeNonPersistentMessages)
Parameters:
storeNonPersistentMessages - The storeNonPersistentMessages to set.

isNoTopicConsumerEnabled

public boolean isNoTopicConsumerEnabled()
Returns:
Returns the noTopicConsumerEnabled.

setNoTopicConsumerEnabled

public void setNoTopicConsumerEnabled(boolean noTopicConsumerEnabled)
Parameters:
noTopicConsumerEnabled - The noTopicConsumerEnabled to set.

isAllowDuplicates

public boolean isAllowDuplicates()
Returns:
Returns the allowDuplicates.

setAllowDuplicates

public void setAllowDuplicates(boolean allowDuplicates)
Parameters:
allowDuplicates - The allowDuplicates to set.

isUseDatabaseLocking

public boolean isUseDatabaseLocking()
Returns:
Returns the useDatabaseLocking.

setUseDatabaseLocking

public void setUseDatabaseLocking(boolean useDatabaseLocking)
Parameters:
useDatabaseLocking - The useDatabaseLocking to set.

setDeadLetterQueueTTL

public void setDeadLetterQueueTTL(long deadLetterQueueTTL)
Parameters:
deadLetterQueueTTL - The deadLetterQueueTTL to set.

setDeadLetterTopicTTL

public void setDeadLetterTopicTTL(long deadLetterTopicTTL)
Parameters:
deadLetterTopicTTL - The deadLetterTopicTTL to set.

getDeadLetterNameFromDestination

public String getDeadLetterNameFromDestination(ActiveMQDestination destination)
Get the name of the DLQ from the destination provided

Parameters:
destination -
Returns:
the name of the DLQ for this Destination

sendToDeadLetter

public void sendToDeadLetter(ActiveMQMessage message)
Send a message to a dead letter queue

Parameters:
message -
Throws:
JMSException

createDeadLetterMessage

protected ActiveMQMessage createDeadLetterMessage(String dlqName,
                                                  ActiveMQMessage message)
                                           throws JMSException
Throws:
JMSException


Copyright © 2004-2010 Protique, Ltd.. All Rights Reserved.