|
18 | 18 |
|
19 | 19 | import java.io.IOException; |
20 | 20 | import java.io.UnsupportedEncodingException; |
21 | | -import java.util.Enumeration; |
22 | | -import java.util.HashMap; |
23 | | -import java.util.List; |
24 | | -import java.util.Map; |
25 | | -import java.util.Vector; |
| 21 | +import java.util.*; |
26 | 22 |
|
27 | 23 | import jakarta.jms.DeliveryMode; |
28 | 24 | import jakarta.jms.Destination; |
@@ -51,6 +47,15 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess |
51 | 47 |
|
52 | 48 | private static final Map<String, PropertySetter> JMS_PROPERTY_SETERS = new HashMap<String, PropertySetter>(); |
53 | 49 |
|
| 50 | + public static final Set<String> STRICT_PROVIDER_JMSX_PROPERTIES = |
| 51 | + Collections.unmodifiableSet(new HashSet<String>(Arrays.asList( |
| 52 | + "JMSXDeliveryCount", |
| 53 | + "JMSXRcvTimestamp", |
| 54 | + "JMSXState", |
| 55 | + "JMSXProducerTXID", |
| 56 | + "JMSXConsumerTXID" |
| 57 | + ))); |
| 58 | + |
54 | 59 | protected transient Callback acknowledgeCallback; |
55 | 60 |
|
56 | 61 | @Override |
@@ -505,11 +510,7 @@ public void setObjectProperty(String name, Object value, boolean checkReadOnly) |
505 | 510 | // Strict Compliance Check For Provider-Set JMSX Properties |
506 | 511 | ActiveMQConnection conn = getConnection(); |
507 | 512 | if (conn != null && conn.isStrictCompliance()) { |
508 | | - if ("JMSXDeliveryCount".equals(name) || |
509 | | - "JMSXRcvTimestamp".equals(name) || |
510 | | - "JMSXState".equals(name) || |
511 | | - "JMSXProducerTXID".equals(name) || |
512 | | - "JMSXConsumerTXID".equals(name)) { |
| 513 | + if (STRICT_PROVIDER_JMSX_PROPERTIES.contains(name)) { |
513 | 514 | throw new JMSException("Provider-set JMSX property '" + name + "' cannot be set by a client under strict compliance."); |
514 | 515 | } |
515 | 516 | } |
|
0 commit comments