Class ClusterConnectionFactory

    • Constructor Detail

      • ClusterConnectionFactory

        public ClusterConnectionFactory()
        Constructs an empty clustered connection factory.
    • Method Detail

      • addConnectionFactory

        public void addConnectionFactory​(ConnectionFactory cf)
        Adds a connection factory to the cluster. The object will be added with a key equals to the location property. By default, the location value is set to the hostname of corresponding server. Be careful, the object should be rebind after modification.
        Parameters:
        cf - the ConnectionFactory
      • addConnectionFactory

        public void addConnectionFactory​(String location,
                                         ConnectionFactory cf)
        Adds a connection factory to the cluster with the specified location key. Be careful, the object should be rebind after modification.
        Parameters:
        location - the location key
        cf - the ConnectionFactory
      • getConnectionFactory

        protected ConnectionFactory getConnectionFactory()
        Chooses a connection factory from the cluster definition.
      • createConnection

        public final jakarta.jms.Connection createConnection()
                                                      throws jakarta.jms.JMSException
        Creates a connection with the default user identity. It chooses a ConnectionFactory depending of the location property, then creates the related Connection. API method, see jakarta.jms.ConnectionFactory.
        Specified by:
        createConnection in interface jakarta.jms.ConnectionFactory
        Throws:
        jakarta.jms.JMSSecurityException - If the default identification is incorrect.
        IllegalStateException - If the server is not listening.
        jakarta.jms.JMSException
      • createConnection

        public final jakarta.jms.Connection createConnection​(String name,
                                                             String password)
                                                      throws jakarta.jms.JMSException
        Creates a connection with the specified user identity. It chooses a ConnectionFactory depending of the location property, then creates the related Connection. API method, see jakarta.jms.ConnectionFactory.
        Specified by:
        createConnection in interface jakarta.jms.ConnectionFactory
        Parameters:
        name - the caller's user name
        password - the caller's password
        Throws:
        jakarta.jms.JMSSecurityException - If the user identification is incorrect.
        IllegalStateException - If the server is not listening.
        jakarta.jms.JMSException
      • toString

        public String toString()
        Returns a String image of the object.
        Overrides:
        toString in class Object
      • createContext

        public jakarta.jms.JMSContext createContext()
        Specified by:
        createContext in interface jakarta.jms.ConnectionFactory
      • createContext

        public jakarta.jms.JMSContext createContext​(String userName,
                                                    String password)
        Specified by:
        createContext in interface jakarta.jms.ConnectionFactory
      • createContext

        public jakarta.jms.JMSContext createContext​(String userName,
                                                    String password,
                                                    int sessionMode)
        Specified by:
        createContext in interface jakarta.jms.ConnectionFactory
      • createContext

        public jakarta.jms.JMSContext createContext​(int sessionMode)
        Specified by:
        createContext in interface jakarta.jms.ConnectionFactory