Class OutboundConnection

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static boolean DEBUG  
      private static Logger logger  
      (package private) ManagedConnectionImpl managedCx
      The managed connection this "handle" belongs to.
      (package private) Vector<OutboundSession> sessions
      Vector of the connection's sessions.
      (package private) boolean valid
      true if this "handle" is valid.
      (package private) jakarta.jms.XAConnection xac
      The physical connection this "handle" handles.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanup()
      Close all sessions.
      void close()
      Requests to close the physical connection.
      boolean cnxEquals​(Object obj)
      Returns true if the parameter is a Connection instance sharing the same proxy identifier and connection key.
      jakarta.jms.ConnectionConsumer createConnectionConsumer​(jakarta.jms.Destination destination, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages)
      Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
      jakarta.jms.ConnectionConsumer createDurableConnectionConsumer​(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages)
      Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
      (package private) jakarta.jms.Session createManagedSession​(int acknowledgeMode)  
      jakarta.jms.Session createSession()  
      jakarta.jms.Session createSession​(boolean transacted, int acknowledgeMode)
      Returns the unique authorized JMS session per connection wrapped in an OutboundSession instance.
      jakarta.jms.Session createSession​(int sessionMode)  
      jakarta.jms.ConnectionConsumer createSharedConnectionConsumer​(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages)  
      jakarta.jms.ConnectionConsumer createSharedDurableConnectionConsumer​(jakarta.jms.Topic topic, String subscriptionName, String messageSelector, jakarta.jms.ServerSessionPool sessionPool, int maxMessages)  
      String getClientID()
      Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
      jakarta.jms.ExceptionListener getExceptionListener()
      Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
      String getJMXBeanName​(jakarta.jms.XAConnection cnx)  
      jakarta.jms.ConnectionMetaData getMetaData()
      Delegates the call to the wrapped JMS connection.
      int getNumberOfSession()  
      String[] getSessions()  
      String registerMBean()  
      void setClientID​(String clientID)
      Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
      void setExceptionListener​(jakarta.jms.ExceptionListener listener)
      Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
      void start()
      Delegates the call to the wrapped JMS connection.
      void stop()
      Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
      String toString()  
      void unregisterMBean()  
    • Field Detail

      • logger

        private static final Logger logger
      • DEBUG

        private static final boolean DEBUG
      • xac

        jakarta.jms.XAConnection xac
        The physical connection this "handle" handles.
      • valid

        boolean valid
        true if this "handle" is valid.
    • Constructor Detail

      • OutboundConnection

        OutboundConnection​(ManagedConnectionImpl managedCx,
                           jakarta.jms.XAConnection xac)
        Constructs an OutboundConnection instance.
        Parameters:
        managedCx - The managed connection building the handle.
        xac - The underlying physical connection to handle.
    • Method Detail

      • cnxEquals

        public boolean cnxEquals​(Object obj)
        Returns true if the parameter is a Connection instance sharing the same proxy identifier and connection key.
      • cleanup

        public void cleanup()
        Close all sessions.
      • createSession

        public jakarta.jms.Session createSession()
                                          throws jakarta.jms.JMSException
        Specified by:
        createSession in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • createSession

        public jakarta.jms.Session createSession​(int sessionMode)
                                          throws jakarta.jms.JMSException
        Specified by:
        createSession in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • createSession

        public jakarta.jms.Session createSession​(boolean transacted,
                                                 int acknowledgeMode)
                                          throws jakarta.jms.JMSException
        Returns the unique authorized JMS session per connection wrapped in an OutboundSession instance.
        Specified by:
        createSession in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.IllegalStateException - If the handle is invalid.
        jakarta.jms.JMSException - Generic exception.
      • createManagedSession

        jakarta.jms.Session createManagedSession​(int acknowledgeMode)
                                          throws jakarta.jms.JMSException
        Throws:
        jakarta.jms.JMSException
      • getClientID

        public String getClientID()
                           throws jakarta.jms.JMSException
        Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
        Specified by:
        getClientID in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • setClientID

        public void setClientID​(String clientID)
                         throws jakarta.jms.JMSException
        Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
        Specified by:
        setClientID in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • getMetaData

        public jakarta.jms.ConnectionMetaData getMetaData()
                                                   throws jakarta.jms.JMSException
        Delegates the call to the wrapped JMS connection.
        Specified by:
        getMetaData in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.IllegalStateException - If the handle is invalid.
        jakarta.jms.JMSException - Generic exception.
      • getExceptionListener

        public jakarta.jms.ExceptionListener getExceptionListener()
                                                           throws jakarta.jms.JMSException
        Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
        Specified by:
        getExceptionListener in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • setExceptionListener

        public void setExceptionListener​(jakarta.jms.ExceptionListener listener)
                                  throws jakarta.jms.JMSException
        Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
        Specified by:
        setExceptionListener in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • start

        public void start()
                   throws jakarta.jms.JMSException
        Delegates the call to the wrapped JMS connection.
        Specified by:
        start in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.IllegalStateException - If the handle is invalid.
        jakarta.jms.JMSException - Generic exception.
      • stop

        public void stop()
                  throws jakarta.jms.JMSException
        Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
        Specified by:
        stop in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • createConnectionConsumer

        public jakarta.jms.ConnectionConsumer createConnectionConsumer​(jakarta.jms.Destination destination,
                                                                       String messageSelector,
                                                                       jakarta.jms.ServerSessionPool sessionPool,
                                                                       int maxMessages)
                                                                throws jakarta.jms.JMSException
        Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
        Specified by:
        createConnectionConsumer in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • createDurableConnectionConsumer

        public jakarta.jms.ConnectionConsumer createDurableConnectionConsumer​(jakarta.jms.Topic topic,
                                                                              String subscriptionName,
                                                                              String messageSelector,
                                                                              jakarta.jms.ServerSessionPool sessionPool,
                                                                              int maxMessages)
                                                                       throws jakarta.jms.JMSException
        Forbidden call on an application or component's outbound connection, throws a IllegalStateException instance.
        Specified by:
        createDurableConnectionConsumer in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • close

        public void close()
                   throws jakarta.jms.JMSException
        Requests to close the physical connection.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface jakarta.jms.Connection
        Specified by:
        close in interface OutboundConnectionMBean
        Throws:
        jakarta.jms.IllegalStateException - If the handle is invalid.
        jakarta.jms.JMSException - Generic exception.
      • createSharedConnectionConsumer

        public jakarta.jms.ConnectionConsumer createSharedConnectionConsumer​(jakarta.jms.Topic topic,
                                                                             String subscriptionName,
                                                                             String messageSelector,
                                                                             jakarta.jms.ServerSessionPool sessionPool,
                                                                             int maxMessages)
                                                                      throws jakarta.jms.JMSException
        Specified by:
        createSharedConnectionConsumer in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • createSharedDurableConnectionConsumer

        public jakarta.jms.ConnectionConsumer createSharedDurableConnectionConsumer​(jakarta.jms.Topic topic,
                                                                                    String subscriptionName,
                                                                                    String messageSelector,
                                                                                    jakarta.jms.ServerSessionPool sessionPool,
                                                                                    int maxMessages)
                                                                             throws jakarta.jms.JMSException
        Specified by:
        createSharedDurableConnectionConsumer in interface jakarta.jms.Connection
        Throws:
        jakarta.jms.JMSException
      • getJMXBeanName

        public String getJMXBeanName​(jakarta.jms.XAConnection cnx)
      • registerMBean

        public String registerMBean()
      • unregisterMBean

        public void unregisterMBean()