* @throws JMSException
*/
private SharedConnection createNewConnection(String userName)
throws NamingException, JMSException {
// Create IC
QpidService qpidService = MessageBoxServiceValueHolder.getInstance().getQpidService();
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, QPID_ICF);
properties.put(CarbonConstants.REQUEST_BASE_CONTEXT, "true");
String connectionURL = null;
if (MB_TYPE_LOCAL.equals(this.type)) {
connectionURL = qpidService.getInternalTCPConnectionURL(userName, qpidService.getAccessKey());
} else {
connectionURL = "amqp://" + userName + ":" + this.accessKey
+ "@" + clientID + "/" + this.virtualHostName
+ "?brokerlist='tcp://" + this.hostName + ":" + this.qpidPort + "'";
}