View Javadoc

    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.JMSException;
    22  import javax.jms.TemporaryTopic;
    23
    24  /***
    25   * A <CODE>TemporaryTopic</CODE> object is a unique <CODE>Topic</CODE> object
    26   * created for the duration of a <CODE>Connection</CODE>. It is a
    27   * system-defined topic that can be consumed only by the
    28   * <CODE>Connection</CODE> that created it.
    29   * <p/>
    30   * <P>A <CODE>TemporaryTopic</CODE> object can be created either at the
    31   * <CODE>Session</CODE> or <CODE>TopicSession</CODE> level. Creating it at the
    32   * <CODE>Session</CODE> level allows the <CODE>TemporaryTopic</CODE> to participate
    33   * in the same transaction with objects from the PTP domain.
    34   * If a <CODE>TemporaryTopic</CODE> is  created at the
    35   * <CODE>TopicSession</CODE>, it will only
    36   * be able participate in transactions with objects from the Pub/Sub domain.
    37   *
    38   * @see javax.jms.Session#createTemporaryTopic()
    39   * @see javax.jms.TopicSession#createTemporaryTopic()
    40   */
    41
    42  public class ActiveMQTemporaryTopic extends ActiveMQTopic implements TemporaryTopic {
    43
    44
    45      /***
    46       * Default constructor for an ActiveMQTemporaryTopic Destination
    47       */
    48      public ActiveMQTemporaryTopic() {
    49          super();
    50      }
    51
    52      /***
    53       * Construct a named ActiveMQTemporaryTopic Destination
    54       *
    55       * @param name
    56       */
    57
    58      public ActiveMQTemporaryTopic(String name) {
    59          super(name);
    60      }
    61
    62      /***
    63       * Deletes this temporary topic. If there are existing subscribers
    64       * still using it, a <CODE>JMSException</CODE> will be thrown.
    65       *
    66       * @throws JMSException if the JMS provider fails to delete the
    67       *                      temporary topic due to some internal error.
    68       */
    69
    70      public void delete() throws JMSException {
    71
    72      }
    73
    74      /***
    75       * @return Returns the Destination type
    76       */
    77
    78      public int getDestinationType() {
    79          return ACTIVEMQ_TEMPORARY_QUEUE;
    80      }
    81  }