Commit def48ff0 authored by Andre Freyssinet's avatar Andre Freyssinet

Factorizes JMS_JORAM property names and fixes an issue with null values

in setProperty.
parent b5a4bae6
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2006 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 2006 - 2021 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -56,13 +56,20 @@ public final class Message implements Cloneable, Serializable, Streamable, Encod
/** define serialVersionUID for interoperability */
private static final long serialVersionUID = 3L;
// default value from javax.jms.Message (jms 1.1)
// default value from javax.jms.Message
public static final int NON_PERSISTENT = 1;
public static final int PERSISTENT = 2;
public static final int DEFAULT_DELIVERY_MODE = PERSISTENT;
public static final int DEFAULT_PRIORITY = 4;
public static final long DEFAULT_TIME_TO_LIVE = 0;
// Reserved property names for Joram
public static final String SWAPALLOWED = "JMS_JORAM_SWAPALLOWED";
public static final String ERRORCOUNT = "JMS_JORAM_ERRORCOUNT";
public static final String ERRORCAUSE_PREFIX = "JMS_JORAM_ERRORCAUSE_";
public static final String ERRORCODE_PREFIX= "JMS_JORAM_ERRORCODE_";
public static final String CORRELATION_ID = "JMS_JORAM_CORRELATIONID";
/** logger */
public static Logger logger = Debug.getLogger(Message.class.getName());
......@@ -118,6 +125,9 @@ public final class Message implements Cloneable, Serializable, Streamable, Encod
if (name == null || name.equals(""))
throw new IllegalArgumentException("Invalid property name: " + name);
if (value == null)
throw new IllegalArgumentException("Property value cannot be null.");
if (properties == null)
properties = new Properties();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment