Class JmsProperty

java.lang.Object
com.trafficparrot.sdk.messaging.JmsProperty
Direct Known Subclasses:
JmsProperty

public class JmsProperty extends Object
A JMS property to set on a response message: one entry of a JMS mapping response's properties, and of JmsResponse.properties.

 new JmsProperty("retryCount", "java.lang.Integer", 3)
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    The property's name.
    final String
    The class name of the property's value: java.lang.Boolean, java.lang.Byte, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double or java.lang.String.
    final Object
    The property's value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    JmsProperty(String name, String type, Object value)
    Creates a property.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setProperty(jakarta.jms.Message message)
    Sets this property on a jakarta.jms message.
    void
    setProperty(javax.jms.Message message)
    Sets this property on a javax.jms message.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      public final String name
      The property's name.
    • type

      public final String type
      The class name of the property's value: java.lang.Boolean, java.lang.Byte, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double or java.lang.String. Any class with a public constructor that takes one String can be named, but JMS accepts only those eight as a property value.
    • value

      public final Object value
      The property's value. It is converted to the type through its text form, so 3 and "3" both give the integer 3 for java.lang.Integer.
  • Constructor Details

    • JmsProperty

      public JmsProperty(String name, String type, Object value)
      Creates a property.
      Parameters:
      name - the property's name
      type - the class name of the property's value, as type describes
      value - the value, converted to that class through its text form
  • Method Details

    • setProperty

      public void setProperty(javax.jms.Message message)
      Sets this property on a javax.jms message.
      Parameters:
      message - the message to set it on
      Throws:
      IllegalArgumentException - if the type is not a class with a public constructor that takes one String, the value cannot be converted to it, or the message refuses the property
    • setProperty

      public void setProperty(jakarta.jms.Message message)
      Sets this property on a jakarta.jms message.
      Parameters:
      message - the message to set it on
      Throws:
      IllegalArgumentException - if the type is not a class with a public constructor that takes one String, the value cannot be converted to it, or the message refuses the property
    • toString

      public String toString()
      Overrides:
      toString in class Object