Exemplo n.º 1
0
 @Override
 public Object getObjectProperty(String name) {
   try {
     SimpleString key = new SimpleString(name);
     Object property = properties.getProperty(key);
     if (stringPropertyNames.contains(key)) {
       property = property.toString();
     }
     return property;
   } catch (HornetQPropertyConversionException ce) {
     throw new MessageFormatRuntimeException(ce.getMessage());
   } catch (RuntimeException e) {
     throw new JMSRuntimeException(e.getMessage());
   }
 }
Exemplo n.º 2
0
  public Map<String, Object> toMap() {
    Map<String, Object> map = new HashMap<String, Object>();

    map.put("messageID", messageID);
    if (userID != null) {
      map.put("userID", "ID:" + userID.toString());
    }
    map.put("address", address.toString());
    map.put("type", type);
    map.put("durable", durable);
    map.put("expiration", expiration);
    map.put("timestamp", timestamp);
    map.put("priority", priority);
    for (SimpleString propName : properties.getPropertyNames()) {
      map.put(propName.toString(), properties.getProperty(propName));
    }
    return map;
  }
Exemplo n.º 3
0
 public Object getObjectProperty(final String key) {
   return properties.getProperty(new SimpleString(key));
 }
Exemplo n.º 4
0
 /**
  * Sets all properties we carry onto the message.
  *
  * @param message
  * @throws JMSException
  */
 private void setProperties(Message message) throws JMSException {
   for (SimpleString name : properties.getPropertyNames()) {
     message.setObjectProperty(name.toString(), properties.getProperty(name));
   }
 }