// first strip all qos properties which are specific
Destination dest = msg.getJMSDestination();
if (!(dest instanceof XBDestination))
throw new XBException("client.configuration", "destination is not an xmlblaster destination. Do not know how to handle it");
PublishQos qos = null;
PublishKey key = null;
if (dest != null) {
XBDestination xbDest = (XBDestination)dest;
String ptpCompleteName = xbDest.getQueueName();
if (ptpCompleteName != null) {
String[] ptpNames = StringPairTokenizer.parseLine(ptpCompleteName, ',');
org.xmlBlaster.util.qos.address.Destination ptpDest = new org.xmlBlaster.util.qos.address.Destination(global, new SessionName(global, ptpNames[0]));
if (xbDest.getForceQueuing())
ptpDest.forceQueuing(true);
qos = new PublishQos(global, ptpDest);
for (int i=1; i < ptpNames.length; i++) {
org.xmlBlaster.util.qos.address.Destination additionalDest = new org.xmlBlaster.util.qos.address.Destination(global, new SessionName(global, ptpNames[i]));
qos.addDestination(additionalDest);
}
}
else {
qos = new PublishQos(global);
}
String tmp = xbDest.getTopicName();
if (tmp == null && ptpCompleteName == null)
throw new XBException("client.configuration", "A Topic must be specified in the message to be sent");
// determine if it is a complete key
if (tmp != null && tmp.indexOf('<') > -1) { // complete key
MsgKeySaxFactory keyFactory = new MsgKeySaxFactory(global);
key = new PublishKey(global, keyFactory.readObject(tmp));
}
else { // then it is a simple oid
if (tmp != null)
key = new PublishKey(global, tmp);
else
key = new PublishKey(global);
}
}
else
throw new XBException("client.configuration", "A destination must be specified in the message to be sent");
String corrId = msg.getJMSCorrelationID();
if (corrId != null)
qos.addClientProperty(XBMessage.addToKeyAndCheck(XBPropertyNames.JMS_CORRELATION_ID), corrId);
int deliveryMode = msg.getJMSDeliveryMode();
if (deliveryMode == DeliveryMode.PERSISTENT)
qos.setPersistent(true);
long expiration = msg.getJMSExpiration();
if (expiration > -1)
qos.setLifeTime(expiration);
int prio = msg.getJMSPriority();
if (prio > -1)
qos.setPriority(PriorityEnum.toPriorityEnum(prio));
String mimeType = msg.getJMSType(); // is this correct ?
if (mimeType != null)
key.setContentMime(mimeType);
Enumeration eNum = msg.getPropertyNames();
while (eNum.hasMoreElements()) {
String propKey = (String)eNum.nextElement();
Object obj = msg.getObjectProperty(propKey);