log.debug("using username/password: " + String.valueOf(username) + "/-- not shown --");
Connection connection = null;
if (factory instanceof XAConnectionFactory) {
XAConnectionFactory qFactory = (XAConnectionFactory) factory;
if (username != null) {
if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
connection = ((XAQueueConnectionFactory)qFactory).createXAQueueConnection(username, password);
} else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
connection = ((XATopicConnectionFactory)qFactory).createXATopicConnection(username, password);
} else {
connection = qFactory.createXAConnection(username, password);
}
} else {
if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
connection = ((XAQueueConnectionFactory)qFactory).createXAQueueConnection();
} else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
connection = ((XATopicConnectionFactory)qFactory).createXATopicConnection();
} else {
connection = qFactory.createXAConnection();
}
}
log.debug("created XAConnection: " + connection);
} else if (factory instanceof ConnectionFactory) {
ConnectionFactory qFactory = (ConnectionFactory) factory;
if (username != null) {
if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
connection = ((QueueConnectionFactory)qFactory).createQueueConnection(username, password);
} else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
connection = ((TopicConnectionFactory)qFactory).createTopicConnection(username, password);
} else {
connection = qFactory.createConnection(username, password);
}
} else {
if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
connection = ((QueueConnectionFactory)qFactory).createQueueConnection();
} else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
connection = ((TopicConnectionFactory)qFactory).createTopicConnection();
} else {
connection = qFactory.createConnection();
}
}
log.debug("created " + mcf.getProperties().getSessionDefaultType() + " connection: " + connection);
} else {