1 /* 2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the License). You may not use this file except in 5 * compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * https://glassfish.dev.java.net/public/CDDLv1.0.html or 9 * glassfish/bootstrap/legal/CDDLv1.0.txt. 10 * See the License for the specific language governing 11 * permissions and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL 14 * Header Notice in each file and include the License file 15 * at glassfish/bootstrap/legal/CDDLv1.0.txt. 16 * If applicable, add the following below the CDDL Header, 17 * with the fields enclosed by brackets [] replaced by 18 * you own identifying information: 19 * "Portions Copyrighted [year] [name of copyright owner]" 20 * 21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 22 */ 23 24 25 package javax.jms; 26 27 28 /** A <CODE>Queue</CODE> object encapsulates a provider-specific queue name. 29 * It is the way a client specifies the identity of a queue to JMS API methods. 30 * For those methods that use a <CODE>Destination</CODE> as a parameter, a 31 * <CODE>Queue</CODE> object used as an argument. For example, a queue can 32 * be used to create a <CODE>MessageConsumer</CODE> and a 33 * <CODE>MessageProducer</CODE> by calling: 34 *<UL> 35 *<LI> <CODE>Session.CreateConsumer(Destination destination)</CODE> 36 *<LI> <CODE>Session.CreateProducer(Destination destination)</CODE> 37 * 38 *</UL> 39 * 40 * <P>The actual length of time messages are held by a queue and the 41 * consequences of resource overflow are not defined by the JMS API. 42 * 43 * 44 * 45 * @version 1.1 February 2 - 2000 46 * @author Mark Hapner 47 * @author Rich Burridge 48 * @author Kate Stout 49 * 50 * @see Session#createConsumer(Destination) 51 * @see Session#createProducer(Destination) 52 * @see Session#createQueue(String) 53 * @see QueueSession#createQueue(String) 54 */ 55 56 public interface Queue extends Destination { 57 58 /** Gets the name of this queue. 59 * 60 * <P>Clients that depend upon the name are not portable. 61 * 62 * @return the queue name 63 * 64 * @exception JMSException if the JMS provider implementation of 65 * <CODE>Queue</CODE> fails to return the queue 66 * name due to some internal 67 * error. 68 */ 69 70 String 71 getQueueName() throws JMSException; 72 73 74 /** Returns a string representation of this object. 75 * 76 * @return the provider-specific identity values for this queue 77 */ 78 79 String 80 toString(); 81 } 82