Class TemporaryQueue

  • All Implemented Interfaces:
    jakarta.jms.Destination, jakarta.jms.Queue, jakarta.jms.TemporaryQueue, Serializable, Referenceable, DestinationMBean, QueueMBean

    public class TemporaryQueue
    extends Queue
    implements jakarta.jms.TemporaryQueue
    Implements the jakarta.jms.TemporaryQueue interface.

    A TemporaryQueue object is a Queue object created for the duration of a Connection. It is a system-defined queue that can be consumed only by the Connection that created it. A TemporaryQueue object can be created at either the Session or QueueSession level.

    See Also:
    Serialized Form
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        define serialVersionUID for interoperability
        See Also:
        Constant Field Values
      • cnx

        private Connection cnx
        The connection the queue belongs to, null if not known.
    • Constructor Detail

      • TemporaryQueue

        public TemporaryQueue()
      • TemporaryQueue

        public TemporaryQueue​(String agentId,
                              Connection cnx)
        Constructs a temporary queue.
        Parameters:
        agentId - Identifier of the queue agent.
        cnx - The connection the queue belongs to, null if not known.
    • Method Detail

      • toString

        public String toString()
        Returns a String image of the queue.
        Specified by:
        toString in interface jakarta.jms.Queue
        Overrides:
        toString in class Queue
        Returns:
        A provider-specific identity values for this queue.
      • delete

        public void delete()
                    throws jakarta.jms.JMSException
        API method. Deletes this temporary queue. If there are existing receivers still using it, a JMSException will be thrown.
        Specified by:
        delete in interface DestinationMBean
        Specified by:
        delete in interface jakarta.jms.TemporaryQueue
        Overrides:
        delete in class Destination
        Throws:
        IllegalStateException - If the connection is closed or broken.
        jakarta.jms.JMSException - If the request fails for any other reason.
      • getCnx

        public Connection getCnx()
        Returns the connection this temporary queue belongs to, null if not known.