public static void setProperty(String name, Object value, Message jmsMessage) throws JMSException { if (jmsMessage == null || name == null) { return; } if (value instanceof Boolean) { jmsMessage.setBooleanProperty(name, ((Boolean) value).booleanValue()); } else if (value instanceof Byte) { jmsMessage.setByteProperty(name, ((Byte) value).byteValue()); } else if (value instanceof Double) { jmsMessage.setDoubleProperty(name, ((Double) value).doubleValue()); } else if (value instanceof Float) { jmsMessage.setFloatProperty(name, ((Float) value).floatValue()); } else if (value instanceof Integer) { jmsMessage.setIntProperty(name, ((Integer) value).intValue()); } else if (value instanceof Long) { jmsMessage.setLongProperty(name, ((Long) value).longValue()); } else if (value instanceof Short) { jmsMessage.setShortProperty(name, ((Short) value).shortValue()); } else if (value instanceof String) { jmsMessage.setStringProperty(name, (String) value); } else { jmsMessage.setObjectProperty(name, value); } }
public static void setEventID(Message message, int eventID) throws JMSException { message.setIntProperty(MessagePropertyNames.EVENT_ID, eventID); }
public static void setEventType(Message message, int eventType) throws JMSException { message.setIntProperty(MessagePropertyNames.EVENT_TYPE, eventType); }