Context context = JMSUtils.getInitialContext(addrDetails);
Connection connection = null;
if (JMSConstants.JMS_QUEUE.equals(addrDetails.getDestinationStyle().value())) {
QueueConnectionFactory qcf =
(QueueConnectionFactory)context.lookup(addrDetails.getJndiConnectionFactoryName());
if (addrDetails.isSetConnectionUserName()) {
connection = qcf.createQueueConnection(addrDetails.getConnectionUserName(),
addrDetails.getConnectionPassword());
} else {
connection = qcf.createQueueConnection();