KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > JMSValidator


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.jms;
8
9 import javax.jms.DeliveryMode JavaDoc;
10 import javax.jms.JMSException JavaDoc;
11
12 /**
13  * Standard validation
14  *
15  * @author <a HREF="mailto:adrian@jboss.org>Adrian Brock</a>
16  * @version $Revision: 1.1 $
17  */

18 public class JMSValidator
19 {
20    // Constants -----------------------------------------------------
21

22    // Attributes ----------------------------------------------------
23

24    // Static --------------------------------------------------------
25

26    /**
27     * Validate the delivery mode
28     *
29     * @param the delivery mode to validate
30     * @throws JMSException for any error
31     */

32    public static void validateDeliveryMode(int deliveryMode)
33       throws JMSException JavaDoc
34    {
35       if (deliveryMode != DeliveryMode.NON_PERSISTENT &&
36           deliveryMode != DeliveryMode.PERSISTENT)
37          throw new JMSException JavaDoc("Invalid delivery mode " + deliveryMode);
38    }
39
40    /**
41     * Validate the priority
42     *
43     * @param the priority to validate
44     * @throws JMSException for any error
45     */

46    public static void validatePriority(int priority)
47       throws JMSException JavaDoc
48    {
49       if (priority < 0 || priority > 9)
50          throw new JMSException JavaDoc("Invalid priority " + priority);
51    }
52
53    /**
54     * Validate the time to live
55     *
56     * @param the ttl to validate
57     * @throws JMSException for any error
58     */

59    public static void validateTimeToLive(long timeToLive)
60       throws JMSException JavaDoc
61    {
62    }
63
64    // Constructors --------------------------------------------------
65

66    // Public --------------------------------------------------------
67

68    // Protected ------------------------------------------------------
69

70    // Package Private ------------------------------------------------
71

72    // Private --------------------------------------------------------
73

74    // Inner Classes --------------------------------------------------
75
}
76
Popular Tags