public Enumeration getPropertyNames() throws JMSException { HashSet<String> set = new HashSet<String>(); for (SimpleString propName : message.getPropertyNames()) { if (!propName.startsWith(HornetQMessage.JMS) || propName.startsWith(HornetQMessage.JMSX) || propName.startsWith(HornetQMessage.JMS_)) { set.add(propName.toString()); } } set.add(HornetQMessage.JMSXDELIVERYCOUNT); return Collections.enumeration(set); }
public void clearProperties() throws JMSException { List<SimpleString> toRemove = new ArrayList<SimpleString>(); for (SimpleString propName : message.getPropertyNames()) { if (!propName.startsWith(HornetQMessage.JMS) || propName.startsWith(HornetQMessage.JMSX) || propName.startsWith(HornetQMessage.JMS_)) { toRemove.add(propName); } } for (SimpleString propName : toRemove) { message.removeProperty(propName); } propertiesReadOnly = false; }
/** * @param address * @throws Exception * @throws HornetQException */ private void validateDestination(SimpleString address) throws Exception, HornetQException { if ((address.startsWith(JMS_QUEUE_PREFIX) || address.startsWith(JMS_TOPIC_PREFIX)) && !address.equals(managementAddress)) { Bindings binding = server.getPostOffice().lookupBindingsForAddress(address); if (binding == null || binding.getBindings().size() == 0) { throw new HornetQException(HornetQException.ADDRESS_DOES_NOT_EXIST, "Address " + address + " has not been deployed"); } } }
/** * @param message */ protected void cleanupInternalPropertiesBeforeRouting(final ServerMessage message) { LinkedList<SimpleString> valuesToRemove = null; for (SimpleString name : message.getPropertyNames()) { // We use properties to establish routing context on clustering. // However if the client resends the message after receiving, it needs to be removed if (name.startsWith(MessageImpl.HDR_ROUTE_TO_IDS) && !name.equals(MessageImpl.HDR_ROUTE_TO_IDS)) { if (valuesToRemove == null) { valuesToRemove = new LinkedList<SimpleString>(); } valuesToRemove.add(name); } } if (valuesToRemove != null) { for (SimpleString removal : valuesToRemove) { message.removeProperty(removal); } } }
/** * @param message */ protected void cleanupInternalPropertiesBeforeRouting(final ServerMessage message) { LinkedList<SimpleString> valuesToRemove = null; for (SimpleString name : message.getPropertyNames()) { // We use properties to establish routing context on clustering. // However if the client resends the message after receiving, it needs to be removed if (name.startsWith(MessageImpl.HDR_ROUTE_TO_IDS) && !name.equals(MessageImpl.HDR_ROUTE_TO_IDS)) { if (valuesToRemove == null) { valuesToRemove = new LinkedList<SimpleString>(); } valuesToRemove.add(name); } } if (valuesToRemove != null) { for (SimpleString removal : valuesToRemove) { message.removeProperty(removal); } } }
private synchronized void doPutValue(final SimpleString key, final PropertyValue value) { if (key.startsWith(HQ_PROPNAME)) { internalProperties = true; } PropertyValue oldValue = properties.put(key, value); if (oldValue != null) { size += value.encodeSize() - oldValue.encodeSize(); } else { size += SimpleString.sizeofString(key) + value.encodeSize(); } }
private synchronized void doPutValue(final SimpleString key, final PropertyValue value) { if (key.startsWith(HQ_PROPNAME)) { internalProperties = true; } PropertyValue oldValue = properties.put(key, value); if (oldValue != null) { size += value.encodeSize() - oldValue.encodeSize(); } else { size += SimpleString.sizeofString(key) + value.encodeSize(); } }
if (id.getName().startsWith(FilterConstants.HORNETQ_PREFIX))
if (id.getName().startsWith(FilterConstants.HORNETQ_PREFIX))
if (propName.startsWith(MessageImpl.HDR_ROUTE_TO_IDS))
if (propName.startsWith(MessageImpl.HDR_ROUTE_TO_IDS))
if (forwardingAddress.startsWith(BridgeImpl.JMS_QUEUE_ADDRESS_PREFIX) || forwardingAddress.startsWith(BridgeImpl.JMS_TOPIC_ADDRESS_PREFIX))
if (forwardingAddress.startsWith(BridgeImpl.JMS_QUEUE_ADDRESS_PREFIX) || forwardingAddress.startsWith(BridgeImpl.JMS_TOPIC_ADDRESS_PREFIX))
if (info.getAddress().startsWith(address))
if (info.getAddress().startsWith(address))