01: /*
02: * The contents of this file are subject to the terms
03: * of the Common Development and Distribution License
04: * (the License). You may not use this file except in
05: * compliance with the License.
06: *
07: * You can obtain a copy of the license at
08: * https://glassfish.dev.java.net/public/CDDLv1.0.html or
09: * glassfish/bootstrap/legal/CDDLv1.0.txt.
10: * See the License for the specific language governing
11: * permissions and limitations under the License.
12: *
13: * When distributing Covered Code, include this CDDL
14: * Header Notice in each file and include the License file
15: * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16: * If applicable, add the following below the CDDL Header,
17: * with the fields enclosed by brackets [] replaced by
18: * you own identifying information:
19: * "Portions Copyrighted [year] [name of copyright owner]"
20: *
21: * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22: */
23:
24: package javax.jms;
25:
26: /**
27: * The delivery modes supported by the JMS API are <CODE>PERSISTENT</CODE> and
28: * <CODE>NON_PERSISTENT</CODE>.
29: *
30: * <P>
31: * A client marks a message as persistent if it feels that the application will
32: * have problems if the message is lost in transit. A client marks a message as
33: * non-persistent if an occasional lost message is tolerable. Clients use
34: * delivery mode to tell a JMS provider how to balance message transport
35: * reliability with throughput.
36: *
37: * <P>
38: * Delivery mode covers only the transport of the message to its destination.
39: * Retention of a message at the destination until its receipt is acknowledged
40: * is not guaranteed by a <CODE>PERSISTENT</CODE> delivery mode. Clients
41: * should assume that message retention policies are set administratively.
42: * Message retention policy governs the reliability of message delivery from
43: * destination to message consumer. For example, if a client's message storage
44: * space is exhausted, some messages may be dropped in accordance with a
45: * site-specific message retention policy.
46: *
47: * <P>
48: * A message is guaranteed to be delivered once and only once by a JMS provider
49: * if the delivery mode of the message is <CODE>PERSISTENT</CODE> and if the
50: * destination has a sufficient message retention policy.
51: *
52: *
53: *
54: * @version 1.0 - 7 August 1998
55: * @author Mark Hapner
56: * @author Rich Burridge
57: */
58:
59: public interface DeliveryMode {
60:
61: /**
62: * This is the lowest-overhead delivery mode because it does not require
63: * that the message be logged to stable storage. The level of JMS provider
64: * failure that causes a <CODE>NON_PERSISTENT</CODE> message to be lost is
65: * not defined.
66: *
67: * <P>
68: * A JMS provider must deliver a <CODE>NON_PERSISTENT</CODE> message with
69: * an at-most-once guarantee. This means that it may lose the message, but
70: * it must not deliver it twice.
71: */
72:
73: static final int NON_PERSISTENT = 1;
74:
75: /**
76: * This delivery mode instructs the JMS provider to log the message to
77: * stable storage as part of the client's send operation. Only a hard media
78: * failure should cause a <CODE>PERSISTENT</CODE> message to be lost.
79: */
80:
81: static final int PERSISTENT = 2;
82: }
|