Package com.trafficparrot.sdk.messaging
Class JmsProperty
java.lang.Object
com.trafficparrot.sdk.messaging.JmsProperty
- Direct Known Subclasses:
JmsProperty
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetProperty(jakarta.jms.Message message) Sets this property on ajakarta.jmsmessage.voidsetProperty(javax.jms.Message message) Sets this property on ajavax.jmsmessage.toString()
-
Field Details
-
name
The property's name. -
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.Doubleorjava.lang.String. Any class with a public constructor that takes oneStringcan be named, but JMS accepts only those eight as a property value. -
value
The property's value. It is converted to thetypethrough its text form, so3and"3"both give the integer 3 forjava.lang.Integer.
-
-
Constructor Details
-
JmsProperty
Creates a property.- Parameters:
name- the property's nametype- the class name of the property's value, astypedescribesvalue- the value, converted to that class through its text form
-
-
Method Details
-
setProperty
public void setProperty(javax.jms.Message message) Sets this property on ajavax.jmsmessage.- Parameters:
message- the message to set it on- Throws:
IllegalArgumentException- if thetypeis not a class with a public constructor that takes oneString, 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 ajakarta.jmsmessage.- Parameters:
message- the message to set it on- Throws:
IllegalArgumentException- if thetypeis not a class with a public constructor that takes oneString, the value cannot be converted to it, or the message refuses the property
-
toString
-