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 DirectConnection method _setClientIDForContext.
/**
* Set clientID to the specified value, bypassing any checks as to whether calling setClientID is allowed at this time.
*/
@Override
public void _setClientIDForContext(String clientID) {
String methodName = "_setClientIDForContext()";
_loggerJC.fine(_lgrMID_INF + "connectionId=" + connectionId + ":" + methodName);
try {
if (!this.inACC) {
_unsupported(methodName);
}
this._checkIfClosed(methodName);
this._setClientID(clientID);
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
}
use of com.sun.messaging.jms.MQRuntimeException in project openmq by eclipse-ee4j.
the class JMSContextImpl method commit.
@Override
public void commit() {
checkNotClosed();
disallowSetClientID();
try {
session.commit();
} catch (TransactionRolledBackException e) {
throw new MQTransactionRolledBackRuntimeException(e);
} catch (TransactionInProgressException e) {
throw new MQTransactionInProgressRuntimeException(e);
} catch (IllegalStateException e) {
throw new MQIllegalStateRuntimeException(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 createBytesMessage.
@Override
public BytesMessage createBytesMessage() {
checkNotClosed();
disallowSetClientID();
try {
return session.createBytesMessage();
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
}
use of com.sun.messaging.jms.MQRuntimeException in project openmq by eclipse-ee4j.
the class JMSContextImpl method createTopic.
@Override
public Topic createTopic(String topicName) {
checkNotClosed();
disallowSetClientID();
try {
return session.createTopic(topicName);
} catch (JMSException e) {
throw new MQRuntimeException(e);
}
}
Aggregations