String msg = "QueueConnectionFactory expected, but got "
+ obj == null ? "null" : obj.getClass().getName();
LOGGER.fatalError(msg);
throw new IllegalStateException(msg);
}
QueueConnectionFactory factory = (QueueConnectionFactory) obj;
Queue sendQueue = (Queue) context.lookup(getSendQueue());
if (!useTemporyQueue()) {
receiveQueue = (Queue) context.lookup(getReceiveQueue());
receiverThread = Receiver.createReceiver(factory, receiveQueue, getPrincipal(context), getCredentials(context)
, isUseResMsgIdAsCorrelId());
}
String principal = null;
String credentials = null;
if (USE_SECURITY_PROPERTIES){
principal = getPrincipal(context);
credentials = getCredentials(context);
}
if (principal != null && credentials != null) {
connection = factory.createQueueConnection(principal, credentials);
} else {
connection = factory.createQueueConnection();
}
session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
if (LOGGER.isDebugEnabled()) {