psdi.iface.jms

Class JMSProducer



  • public class JMSProducer
    extends JMSClient
    This class will write messages to a Destination synchronously.
    • Field Detail

      • producer

        protected javax.jms.MessageProducer producer
        The MessageProducer instance which will be used to wrote messages to the Destination.
      • messageBuffer

        protected java.util.List messageBuffer
    • Constructor Detail

      • JMSProducer

        public JMSProducer(java.lang.String destinationName,
                           java.lang.String conFactoryName,
                           int txMode,
                           java.util.Properties env,
                           java.lang.String providerUserName,
                           java.lang.String providerPassword)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        conFactoryName - the JNDI name of the ConnectionFactory.
        txMode - The transaction mode for the JMS client Session.
        env - The env properties to get an InitialContext.
        providerUserName - The provider connection user.
        providerPassword - The provider connection password.
        Throws:
        MXException
      • JMSProducer

        public JMSProducer(java.lang.String destinationName,
                           java.lang.String conFactoryName,
                           int txMode,
                           java.util.Properties env)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        conFactoryName - the JNDI name of the ConnectionFactory.
        txMode - The transaction mode for the JMS client Session.
        env - The env properties to get an InitialContext.
        Throws:
        MXException
      • JMSProducer

        public JMSProducer(java.lang.String destinationName,
                           javax.jms.Session session,
                           java.util.Properties env)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        session - the JMS session from which the client should be created.
        env - The env properties to get an InitialContext.
        Throws:
        MXException
    • Method Detail

      • createClient

        protected void createClient()
                             throws MXException
        Description copied from class: JMSClient
        Internal method to create the MessageConsumer from the JMS Session.
        Throws:
        MXException
      • addMessage

        public void addMessage(JMSData data)
        Parameters:
        data -
      • sendMessage

        public void sendMessage(boolean autocommit)
                         throws MXException
        Parameters:
        autocommit -
        Throws:
        MXException
      • sendMessage

        public void sendMessage(java.util.List listData,
                                boolean autocommit)
                         throws MXException
        Write a List of messages to the Destination. All the messages will be part of the same transaction.
        Parameters:
        listData - the list of JMSData objects each representing one jms Message.
        autocommit - If set to true will commit the transaction if invoked in the context of a JMS Session transaction.
        Throws:
        MXException
      • sendMessage

        public void sendMessage(JMSData data,
                                boolean autocommit)
                         throws MXException
        Write a message to the Destination.
        Parameters:
        data - the JMSData object representing a jms message.
        autocommit - If set to true will commit the transaction if invoked in the context of a JMS Session transaction.
        Throws:
        MXException
      • close

        public void close()
        Description copied from class: JMSClient
        Releses all resources that is cached by the client like JMS Session and Connection. If the Session is owned by another client then this operation will not close that Session (and Connection). Calling this method on the originating client (which created the Session and Connection) will close these resources.
        Overrides:
        close in class JMSClient
      • createClientInSession

        public JMSClient createClientInSession()
                                        throws MXException
        Description copied from class: JMSClient
        Creates another JMSClient of the same type in this clients Session. This is used for making the this client and the newly created client to work off the same Session and hence be in the same JMS transaction context.
        Specified by:
        createClientInSession in class JMSClient
        Returns:
        the newly created JMSClient instance.
        Throws:
        MXException
      • createClientInSession

        public JMSClient createClientInSession(java.lang.String destinationName,
                                               java.util.Properties env)
                                        throws MXException
        Description copied from class: JMSClient
        Creates another JMSClient of the same type in this clients Session. This is used for making the this client and the newly created client to work off the same Session and hence be in the same JMS transaction context.
        Specified by:
        createClientInSession in class JMSClient
        Returns:
        the newly created JMSClient instance.
        Throws:
        MXException
      • createJMSConsumerInSession

        public JMSConsumer createJMSConsumerInSession(java.lang.String selector)
                                               throws MXException
        Create a JMSConsumer in the same session as this JMSProducer.
        Parameters:
        selector - the message selector for the consumer.
        Returns:
        newly created JMSConsumer instance.
        Throws:
        MXException