Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/activemq/message/ActiveMQTemporaryQueue.java


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.activemq.message;
20  
21  import javax.jms.TemporaryQueue;
22  
23  
24  /**
25   * A <CODE>TemporaryQueue</CODE> object is a unique <CODE>Queue</CODE> object
26   * created for the duration of a <CODE>Connection</CODE>. It is a
27   * system-defined queue that can be consumed only by the
28   * <CODE>Connection</CODE> that created it.
29   * <p/>
30   * <P>A <CODE>TemporaryQueue</CODE> object can be created at either the
31   * <CODE>Session</CODE> or <CODE>QueueSession</CODE> level. Creating it at the
32   * <CODE>Session</CODE> level allows to the <CODE>TemporaryQueue</CODE> to
33   * participate in transactions with objects from the Pub/Sub  domain.
34   * If it is created at the <CODE>QueueSession</CODE>, it will only
35   * be able participate in transactions with objects from the PTP domain.
36   *
37   * @see javax.jms.Session#createTemporaryQueue()
38   * @see javax.jms.QueueSession#createTemporaryQueue()
39   */
40  
41  public class ActiveMQTemporaryQueue extends ActiveMQQueue implements TemporaryQueue {
42  
43      private static final long serialVersionUID = 2177608393508673752L;
44  
45      /**
46       * Default constructor for an ActiveMQTemporaryQueue Destination
47       */
48      public ActiveMQTemporaryQueue() {
49          super();
50      }
51  
52      /**
53       * Construct a named ActiveMQTemporaryQueue Destination
54       *
55       * @param name
56       */
57  
58      public ActiveMQTemporaryQueue(String name) {
59          super(name);
60      }
61      
62      /**
63       * @return Returns the Destination type
64       */
65  
66      public int getDestinationType() {
67          return ACTIVEMQ_TEMPORARY_QUEUE;
68      }
69      
70      /**
71       * Returns true if a temporary Destination
72       *
73       * @return true/false
74       */
75  
76      public boolean isTemporary() {
77          return true;
78      }
79      
80      /**
81      * Returns true if a Topic Destination
82      *
83      * @return true/false
84      */
85  
86     public boolean isTopic() {
87         return false;
88     }
89  
90     /**
91      * Returns true if a Queue Destination
92      *
93      * @return true/false
94      */
95     public boolean isQueue() {
96         return true;
97     }
98      
99  }