/** * Static inspection method to determine if a named property exists for a given message. * * @param message the JmsMessageFacade instance to read from * @param name the property name that is being inspected. * @return true if the message contains the given property. * @throws JMSException if an error occurs while validating the defined property. */ public static boolean propertyExists(JmsMessageFacade message, String name) throws JMSException { PropertyIntercepter jmsPropertyExpression = PROPERTY_INTERCEPTERS.get(name); if (jmsPropertyExpression != null) { return jmsPropertyExpression.propertyExists(message); } else { return message.propertyExists(name); } }
/** * Static set method that takes a property name and sets the value either via a registered * property set object or through the JmsMessageFacade setProperty method. * * @param message the JmsMessageFacade instance to write to. * @param name the property name that is being written. * @param value the new value to assign for the named property. * @throws JMSException if an error occurs while writing the defined property. */ public static void setProperty(JmsMessageFacade message, String name, Object value) throws JMSException { PropertyIntercepter jmsPropertyExpression = PROPERTY_INTERCEPTERS.get(name); if (jmsPropertyExpression != null) { jmsPropertyExpression.setProperty(message, value); } else { message.setProperty(name, value); } }
/** * Static get method that takes a property name and gets the value either via a registered * property get object or through the JmsMessageFacade getProperty method. * * @param message the JmsMessageFacade instance to read from * @param name the property name that is being requested. * @return the correct value either mapped to an Message attribute of a Message property. * @throws JMSException if an error occurs while reading the defined property. */ public static Object getProperty(JmsMessageFacade message, String name) throws JMSException { Object value = null; PropertyIntercepter jmsPropertyExpression = PROPERTY_INTERCEPTERS.get(name); if (jmsPropertyExpression != null) { value = jmsPropertyExpression.getProperty(message); } else { value = message.getProperty(name); } return value; }