KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > resource > adapter > jms > inflow > DLQHandler


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.resource.adapter.jms.inflow;
23
24 import javax.jms.Message JavaDoc;
25 import javax.naming.Context JavaDoc;
26
27 /**
28  * An interface for DLQ Handling
29  *
30  * @author <a HREF="adrian@jboss.com">Adrian Brock</a>
31  * @version $Revision: 38447 $
32  */

33 public interface DLQHandler
34 {
35    /** JMS property name holding original destination. */
36    static final String JavaDoc JBOSS_ORIG_DESTINATION = "JBOSS_ORIG_DESTINATION";
37
38    /** JMS property name holding original JMS message id. */
39    static final String JavaDoc JBOSS_ORIG_MESSAGEID = "JBOSS_ORIG_MESSAGEID";
40
41    /** Standard property for delivery count */
42    static final String JavaDoc PROPERTY_DELIVERY_COUNT = "JMSXDeliveryCount";
43
44    /**
45     * Set up the DLQ
46     *
47     * @param activation the activation
48     * @param ctx the naming context
49     * @throws Exception for any error
50     */

51    void setup(JmsActivation activation, Context JavaDoc ctx) throws Exception JavaDoc;
52
53    /**
54     * Tear down the DLQ
55     */

56    void teardown();
57    
58    /**
59     * Check whether the DLQ should handle the message
60     *
61     * @param msg the message about to be delivered
62     * @return true if the message is handled and should not be delivered
63     */

64    boolean handleRedeliveredMessage(Message JavaDoc msg);
65    
66    /**
67     * Notification that the message was delivered
68     *
69     * @param msg the message that was delivered
70     */

71    void messageDelivered(Message JavaDoc msg);
72 }
73
Popular Tags