1 /***
2 *
3 * Copyright 2004 Protique Ltd
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 **/
18
19 package org.codehaus.activemq.message;
20
21 import javax.jms.Queue;
22
23
24 /***
25 * A <CODE>Queue</CODE> object encapsulates a provider-specific queue name.
26 * It is the way a client specifies the identity of a queue to JMS API methods.
27 * For those methods that use a <CODE>Destination</CODE> as a parameter, a
28 * <CODE>Queue</CODE> object used as an argument. For example, a queue can
29 * be used to create a <CODE>MessageConsumer</CODE> and a
30 * <CODE>MessageProducer</CODE> by calling:
31 * <UL>
32 * <LI> <CODE>Session.CreateConsumer(Destination destination)</CODE>
33 * <LI> <CODE>Session.CreateProducer(Destination destination)</CODE>
34 * <p/>
35 * </UL>
36 * <p/>
37 * <P>The actual length of time messages are held by a queue and the
38 * consequences of resource overflow are not defined by the JMS API.
39 *
40 * @see javax.jms.Session#createConsumer(javax.jms.Destination)
41 * @see javax.jms.Session#createProducer(javax.jms.Destination)
42 * @see javax.jms.Session#createQueue(String)
43 * @see javax.jms.QueueSession#createQueue(String)
44 */
45
46 public class ActiveMQQueue extends ActiveMQDestination implements Queue {
47
48 /***
49 * Default constructor for an ActiveMQQueue Destination
50 */
51 public ActiveMQQueue() {
52 super();
53 }
54
55 /***
56 * Construct a named ActiveMQQueue Destination
57 *
58 * @param name
59 */
60
61 public ActiveMQQueue(String name) {
62 super(name);
63 }
64
65 /***
66 * Gets the name of this queue.
67 * <p/>
68 * <P>Clients that depend upon the name are not portable.
69 *
70 * @return the queue name
71 */
72
73 public String getQueueName() {
74 return super.getPhysicalName();
75 }
76
77 /***
78 * @return Returns the Destination type
79 */
80
81 public int getDestinationType() {
82 return ACTIVEMQ_QUEUE;
83 }
84 }