public void setObjectProperty(final String name, final Object value) throws JMSException { checkProperty(name, value); SimpleString key = new SimpleString(name); if (value instanceof Boolean) { message.putBooleanProperty(key, (Boolean) value); } else if (value instanceof Byte) { message.putByteProperty(key, (Byte) value); } else if (value instanceof Short) { message.putShortProperty(key, (Short) value); } else if (value instanceof Integer) { message.putIntProperty(key, (Integer) value); } else if (value instanceof Long) { message.putLongProperty(key, (Long) value); } else if (value instanceof Float) { message.putFloatProperty(key, (Float) value); } else if (value instanceof Double) { message.putDoubleProperty(key, (Double) value); } else if (value instanceof String) { message.putStringProperty(key, new SimpleString((String) value)); } else { throw new MessageFormatException("Invalid property type"); } }
public void setIntProperty(final String name, final int value) throws JMSException { Integer i = new Integer(value); checkProperty(name, i); message.putIntProperty(new SimpleString(name), value); }