01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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 javax.jms;
23:
24: /** The delivery modes supported by the JMS API are <CODE>PERSISTENT</CODE> and
25: * <CODE>NON_PERSISTENT</CODE>.
26: *
27: * <P>A client marks a message as persistent if it feels that the
28: * application will have problems if the message is lost in transit.
29: * A client marks a message as non-persistent if an occasional
30: * lost message is tolerable. Clients use delivery mode to tell a
31: * JMS provider how to balance message transport reliability with throughput.
32: *
33: * <P>Delivery mode covers only the transport of the message to its
34: * destination. Retention of a message at the destination until
35: * its receipt is acknowledged is not guaranteed by a <CODE>PERSISTENT</CODE>
36: * delivery mode. Clients should assume that message retention
37: * policies are set administratively. Message retention policy
38: * governs the reliability of message delivery from destination
39: * to message consumer. For example, if a client's message storage
40: * space is exhausted, some messages may be dropped in accordance with
41: * a site-specific message retention policy.
42: *
43: * <P>A message is guaranteed to be delivered once and only once
44: * by a JMS provider if the delivery mode of the message is
45: * <CODE>PERSISTENT</CODE>
46: * and if the destination has a sufficient message retention policy.
47: *
48: */
49: public interface DeliveryMode {
50:
51: /** This is the lowest-overhead delivery mode because it does not require
52: * that the message be logged to stable storage. The level of JMS provider
53: * failure that causes a <CODE>NON_PERSISTENT</CODE> message to be lost is
54: * not defined.
55: *
56: * <P>A JMS provider must deliver a <CODE>NON_PERSISTENT</CODE> message
57: * with an
58: * at-most-once guarantee. This means that it may lose the message, but it
59: * must not deliver it twice.
60: */
61:
62: static final int NON_PERSISTENT = 1;
63:
64: /** This delivery mode instructs the JMS provider to log the message to stable
65: * storage as part of the client's send operation. Only a hard media
66: * failure should cause a <CODE>PERSISTENT</CODE> message to be lost.
67: */
68:
69: static final int PERSISTENT = 2;
70: }
|