/** * For each of the currently configured message property intercepter instance a string key value * is inserted into an Set and returned if the property has a value and is available for a read * operation. The Set returned may be manipulated by the receiver without impacting the facade, * and an empty set will be returned if there are no matching properties. * * @param message the JmsMessageFacade instance to read from * @param excludeStandardJMSHeaders whether the standard JMS header names should be excluded from * the returned set * @return a {@code Set<String>} containing the names of all intercepted properties with a value. * @throws JMSException if an error occurs while gathering the message property names. */ public static Set<String> getPropertyNames( JmsMessageFacade message, boolean excludeStandardJMSHeaders) throws JMSException { Set<String> names = new HashSet<String>(); for (Entry<String, PropertyIntercepter> entry : PROPERTY_INTERCEPTERS.entrySet()) { if (excludeStandardJMSHeaders && STANDARD_HEADERS.contains(entry.getKey())) { continue; } if (entry.getValue().propertyExists(message)) { names.add(entry.getKey()); } } names.addAll(message.getPropertyNames()); return names; }
/** * For each of the currently configured message property intercepter instance a string key value * is inserted into an Set and returned. * * @param message the JmsMessageFacade instance to read property names from. * @return a {@code Set<String>} containing the names of all intercepted properties. * @throws JMSException if an error occurs while gathering the message property names. */ public static Set<String> getAllPropertyNames(JmsMessageFacade message) throws JMSException { Set<String> names = new HashSet<String>(PROPERTY_INTERCEPTERS.keySet()); names.addAll(message.getPropertyNames()); return names; }