001    /** 
002     * 
003     * Copyright 2004 Protique Ltd
004     * 
005     * Licensed under the Apache License, Version 2.0 (the "License"); 
006     * you may not use this file except in compliance with the License. 
007     * You may obtain a copy of the License at 
008     * 
009     * http://www.apache.org/licenses/LICENSE-2.0
010     * 
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS, 
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
014     * See the License for the specific language governing permissions and 
015     * limitations under the License. 
016     * 
017     **/
018    
019    package org.activemq.message;
020    
021    import javax.jms.TemporaryQueue;
022    
023    
024    /**
025     * A <CODE>TemporaryQueue</CODE> object is a unique <CODE>Queue</CODE> object
026     * created for the duration of a <CODE>Connection</CODE>. It is a
027     * system-defined queue that can be consumed only by the
028     * <CODE>Connection</CODE> that created it.
029     * <p/>
030     * <P>A <CODE>TemporaryQueue</CODE> object can be created at either the
031     * <CODE>Session</CODE> or <CODE>QueueSession</CODE> level. Creating it at the
032     * <CODE>Session</CODE> level allows to the <CODE>TemporaryQueue</CODE> to
033     * participate in transactions with objects from the Pub/Sub  domain.
034     * If it is created at the <CODE>QueueSession</CODE>, it will only
035     * be able participate in transactions with objects from the PTP domain.
036     *
037     * @see javax.jms.Session#createTemporaryQueue()
038     * @see javax.jms.QueueSession#createTemporaryQueue()
039     */
040    
041    public class ActiveMQTemporaryQueue extends ActiveMQQueue implements TemporaryQueue {
042    
043        private static final long serialVersionUID = 2177608393508673752L;
044    
045        /**
046         * Default constructor for an ActiveMQTemporaryQueue Destination
047         */
048        public ActiveMQTemporaryQueue() {
049            super();
050        }
051    
052        /**
053         * Construct a named ActiveMQTemporaryQueue Destination
054         *
055         * @param name
056         */
057    
058        public ActiveMQTemporaryQueue(String name) {
059            super(name);
060        }
061        
062        /**
063         * @return Returns the Destination type
064         */
065    
066        public int getDestinationType() {
067            return ACTIVEMQ_TEMPORARY_QUEUE;
068        }
069        
070        /**
071         * Returns true if a temporary Destination
072         *
073         * @return true/false
074         */
075    
076        public boolean isTemporary() {
077            return true;
078        }
079        
080        /**
081        * Returns true if a Topic Destination
082        *
083        * @return true/false
084        */
085    
086       public boolean isTopic() {
087           return false;
088       }
089    
090       /**
091        * Returns true if a Queue Destination
092        *
093        * @return true/false
094        */
095       public boolean isQueue() {
096           return true;
097       }
098        
099    }