use of com.sun.messaging.jms.MQMessageFormatRuntimeException in project openmq by eclipse-ee4j.
the class JMSProducerImpl method getShortProperty.
@Override
public short getShortProperty(String name) {
contextImpl.checkNotClosed();
MessageImpl.checkPropertyNameSet(name);
Object obj = properties.get(name);
try {
return ValueConvert.toShort(obj);
} catch (MessageFormatException e) {
throw new MQMessageFormatRuntimeException(e);
}
}
use of com.sun.messaging.jms.MQMessageFormatRuntimeException in project openmq by eclipse-ee4j.
the class JMSProducerImpl method send.
@Override
public JMSProducer send(Destination destination, Map<String, Object> payload) {
contextImpl.checkNotClosed();
configureMessageProducer();
MapMessage mapMessage = contextImpl.createMapMessage();
configureMessage(mapMessage);
if (payload != null) {
try {
for (Iterator<Entry<String, Object>> entryIter = payload.entrySet().iterator(); entryIter.hasNext(); ) {
Entry<String, Object> thisEntry = entryIter.next();
mapMessage.setObject(thisEntry.getKey(), thisEntry.getValue());
}
} catch (MessageNotWriteableException e) {
throw new MQMessageNotWriteableRuntimeException(e);
} catch (MessageFormatException e) {
throw new MQMessageFormatRuntimeException(e);
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
}
try {
if (completionListener == null) {
contextImpl.getMessageProducer().send(destination, mapMessage);
} else {
contextImpl.getMessageProducer().send(destination, mapMessage, completionListener);
}
} catch (InvalidDestinationException e) {
throw new MQInvalidDestinationRuntimeException(e);
} catch (MessageFormatException e) {
throw new MQMessageFormatRuntimeException(e);
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
return this;
}
use of com.sun.messaging.jms.MQMessageFormatRuntimeException in project openmq by eclipse-ee4j.
the class JMSProducerImpl method getIntProperty.
@Override
public int getIntProperty(String name) {
contextImpl.checkNotClosed();
MessageImpl.checkPropertyNameSet(name);
Object obj = properties.get(name);
try {
return ValueConvert.toInt(obj);
} catch (MessageFormatException e) {
throw new MQMessageFormatRuntimeException(e);
}
}
use of com.sun.messaging.jms.MQMessageFormatRuntimeException in project openmq by eclipse-ee4j.
the class JMSProducerImpl method send.
@Override
public JMSProducer send(Destination destination, Message message) {
contextImpl.checkNotClosed();
checkMessage(message);
configureMessageProducer();
configureMessage(message);
try {
if (completionListener == null) {
contextImpl.getMessageProducer().send(destination, message);
} else {
contextImpl.getMessageProducer().send(destination, message, completionListener);
}
} catch (InvalidDestinationException e) {
throw new MQInvalidDestinationRuntimeException(e);
} catch (MessageFormatException e) {
throw new MQMessageFormatRuntimeException(e);
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
return this;
}
use of com.sun.messaging.jms.MQMessageFormatRuntimeException in project openmq by eclipse-ee4j.
the class JMSProducerImpl method getBooleanProperty.
@Override
public boolean getBooleanProperty(String name) {
contextImpl.checkNotClosed();
MessageImpl.checkPropertyNameSet(name);
try {
return ValueConvert.toBoolean(properties.get(name));
} catch (MessageFormatException e) {
throw new MQMessageFormatRuntimeException(e);
}
}
Aggregations