use of com.sun.messaging.jms.MQRuntimeException 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.MQRuntimeException in project openmq by eclipse-ee4j.
the class JMSContextImpl method createObjectMessage.
@Override
public ObjectMessage createObjectMessage() {
checkNotClosed();
disallowSetClientID();
try {
return session.createObjectMessage();
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
}
use of com.sun.messaging.jms.MQRuntimeException in project openmq by eclipse-ee4j.
the class JMSContextImpl method createTemporaryQueue.
@Override
public TemporaryQueue createTemporaryQueue() {
checkNotClosed();
disallowSetClientID();
try {
return session.createTemporaryQueue();
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
}
use of com.sun.messaging.jms.MQRuntimeException in project openmq by eclipse-ee4j.
the class JMSContextImpl method createBrowser.
@Override
public QueueBrowser createBrowser(Queue queue) {
checkNotClosed();
disallowSetClientID();
try {
return session.createBrowser(queue);
} catch (InvalidDestinationException e) {
throw new MQInvalidDestinationRuntimeException(e);
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
}
use of com.sun.messaging.jms.MQRuntimeException in project openmq by eclipse-ee4j.
the class JMSContextImpl method createMapMessage.
@Override
public MapMessage createMapMessage() {
checkNotClosed();
disallowSetClientID();
try {
return session.createMapMessage();
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
}
Aggregations