001 /** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 package org.apache.activemq.broker.region.policy; 018 019 import org.apache.activemq.command.ActiveMQDestination; 020 import org.apache.activemq.command.Message; 021 022 /** 023 * A strategy for choosing which destination is used for dead letter queue messages. 024 * 025 * @version $Revision: 668146 $ 026 */ 027 public interface DeadLetterStrategy { 028 029 /** 030 * Allow pluggable strategy for deciding if message should be sent to a dead letter queue 031 * for example, you might not want to ignore expired or non-persistent messages 032 * @param message 033 * @return true if message should be sent to a dead letter queue 034 */ 035 boolean isSendToDeadLetterQueue(Message message); 036 037 /** 038 * Returns the dead letter queue for the given destination. 039 */ 040 ActiveMQDestination getDeadLetterQueueFor(ActiveMQDestination originalDestination); 041 042 /** 043 * @return true if processes expired messages 044 */ 045 public boolean isProcessExpired() ; 046 047 /** 048 * @param processExpired the processExpired to set 049 */ 050 public void setProcessExpired(boolean processExpired); 051 052 /** 053 * @return the processNonPersistent 054 */ 055 public boolean isProcessNonPersistent(); 056 057 /** 058 * @param processNonPersistent the processNonPersistent to set 059 */ 060 public void setProcessNonPersistent(boolean processNonPersistent); 061 062 }