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.TemporaryTopic; 022 023 /** 024 * A <CODE>TemporaryTopic</CODE> object is a unique <CODE>Topic</CODE> object 025 * created for the duration of a <CODE>Connection</CODE>. It is a 026 * system-defined topic that can be consumed only by the 027 * <CODE>Connection</CODE> that created it. 028 * <p/> 029 * <P>A <CODE>TemporaryTopic</CODE> object can be created either at the 030 * <CODE>Session</CODE> or <CODE>TopicSession</CODE> level. Creating it at the 031 * <CODE>Session</CODE> level allows the <CODE>TemporaryTopic</CODE> to participate 032 * in the same transaction with objects from the PTP domain. 033 * If a <CODE>TemporaryTopic</CODE> is created at the 034 * <CODE>TopicSession</CODE>, it will only 035 * be able participate in transactions with objects from the Pub/Sub domain. 036 * 037 * @see javax.jms.Session#createTemporaryTopic() 038 * @see javax.jms.TopicSession#createTemporaryTopic() 039 */ 040 041 public class ActiveMQTemporaryTopic extends ActiveMQTopic implements TemporaryTopic { 042 043 private static final long serialVersionUID = 8331978134488919460L; 044 045 /** 046 * Default constructor for an ActiveMQTemporaryTopic Destination 047 */ 048 public ActiveMQTemporaryTopic() { 049 super(); 050 } 051 052 /** 053 * Construct a named ActiveMQTemporaryTopic Destination 054 * 055 * @param name 056 */ 057 058 public ActiveMQTemporaryTopic(String name) { 059 super(name); 060 } 061 062 /** 063 * @return Returns the Destination type 064 */ 065 public int getDestinationType() { 066 return ACTIVEMQ_TEMPORARY_TOPIC; 067 } 068 069 /** 070 * Returns true if a temporary Destination 071 * 072 * @return true/false 073 */ 074 075 public boolean isTemporary() { 076 return true; 077 } 078 079 }