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 Details

    • createMessage

      JmsMessage createMessage() throws jakarta.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:
      jakarta.jms.JMSException - if the provider cannot create the message for some reason.
    • createTextMessage

      JmsTextMessage createTextMessage(String payload) throws jakarta.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:
      jakarta.jms.JMSException - if the provider cannot create the message for some reason.
    • createTextMessage

      JmsTextMessage createTextMessage() throws jakarta.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:
      jakarta.jms.JMSException - if the provider cannot create the message for some reason.
    • createBytesMessage

      JmsBytesMessage createBytesMessage() throws jakarta.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:
      jakarta.jms.JMSException - if the provider cannot create the message for some reason.
    • createMapMessage

      JmsMapMessage createMapMessage() throws jakarta.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:
      jakarta.jms.JMSException - if the provider cannot create the message for some reason.
    • createStreamMessage

      JmsStreamMessage createStreamMessage() throws jakarta.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:
      jakarta.jms.JMSException - if the provider cannot create the message for some reason.
    • createObjectMessage

      JmsObjectMessage createObjectMessage(Serializable payload) throws jakarta.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:
      jakarta.jms.JMSException - if the provider cannot create the message for some reason.
    • createObjectMessage

      JmsObjectMessage createObjectMessage() throws jakarta.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:
      jakarta.jms.JMSException - if the provider cannot create the message for some reason.