Interface JmsMessageFactory

  • All Known Implementing Classes:
    AmqpJmsMessageFactory

    public interface JmsMessageFactory
    Interface that a Provider should implement to provide a Provider Specific JmsMessage implementation that optimizes the exchange of message properties and payload between the JMS Message API and the underlying Provider Message implementations.
    • Method Detail

      • createMessage

        JmsMessage createMessage()
                          throws javax.jms.JMSException
        Creates an instance of a basic JmsMessage object. The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
        Returns:
        a newly created and initialized JmsMessage instance.
        Throws:
        javax.jms.JMSException - if the provider cannot create the message for some reason.
      • createTextMessage

        JmsTextMessage createTextMessage​(java.lang.String payload)
                                  throws javax.jms.JMSException
        Creates an instance of a basic JmsTextMessage object. The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
        Parameters:
        payload - The value to initially assign to the Message body, or null if empty to start.
        Returns:
        a newly created and initialized JmsTextMessage instance.
        Throws:
        javax.jms.JMSException - if the provider cannot create the message for some reason.
      • createTextMessage

        JmsTextMessage createTextMessage()
                                  throws javax.jms.JMSException
        Creates an instance of a basic JmsTextMessage object. The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
        Returns:
        a newly created and initialized JmsTextMessage instance.
        Throws:
        javax.jms.JMSException - if the provider cannot create the message for some reason.
      • createBytesMessage

        JmsBytesMessage createBytesMessage()
                                    throws javax.jms.JMSException
        Creates an instance of a basic JmsBytesMessage object. The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
        Returns:
        a newly created and initialized JmsTextMessage instance.
        Throws:
        javax.jms.JMSException - if the provider cannot create the message for some reason.
      • createMapMessage

        JmsMapMessage createMapMessage()
                                throws javax.jms.JMSException
        Creates an instance of a basic JmsMapMessage object. The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
        Returns:
        a newly created and initialized JmsTextMessage instance.
        Throws:
        javax.jms.JMSException - if the provider cannot create the message for some reason.
      • createStreamMessage

        JmsStreamMessage createStreamMessage()
                                      throws javax.jms.JMSException
        Creates an instance of a basic JmsStreamMessage object. The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
        Returns:
        a newly created and initialized JmsTextMessage instance.
        Throws:
        javax.jms.JMSException - if the provider cannot create the message for some reason.
      • createObjectMessage

        JmsObjectMessage createObjectMessage​(java.io.Serializable payload)
                                      throws javax.jms.JMSException
        Creates an instance of a basic JmsObjectMessage object. The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
        Parameters:
        payload - The value to initially assign to the Message body, or null if empty to start.
        Returns:
        a newly created and initialized JmsObjectMessage instance.
        Throws:
        javax.jms.JMSException - if the provider cannot create the message for some reason.
      • createObjectMessage

        JmsObjectMessage createObjectMessage()
                                      throws javax.jms.JMSException
        Creates an instance of a basic JmsObjectMessage object. The provider may either create the Message with the default generic internal message implementation or create a Provider specific instance that optimizes the access and marshaling of the message.
        Returns:
        a newly created and initialized JmsObjectMessage instance.
        Throws:
        javax.jms.JMSException - if the provider cannot create the message for some reason.