*/
protected QueueConnection setupQueueConnection(Context ctx, String user, String pass, String clientID) throws Exception
{
String queueFactoryRef = adapter.getQueueFactoryRef();
log.debug("Attempting to lookup queue connection factory " + queueFactoryRef);
QueueConnectionFactory qcf = (QueueConnectionFactory) Util.lookup(ctx, queueFactoryRef, QueueConnectionFactory.class);
log.debug("Got queue connection factory " + qcf + " from " + queueFactoryRef);
log.debug("Attempting to create queue connection with user " + user);
QueueConnection result;
if (qcf instanceof XAQueueConnectionFactory && isDeliveryTransacted)
{
XAQueueConnectionFactory xaqcf = (XAQueueConnectionFactory) qcf;
if (user != null)
result = xaqcf.createXAQueueConnection(user, pass);
else
result = xaqcf.createXAQueueConnection();
}
else
{
if (user != null)
result = qcf.createQueueConnection(user, pass);
else
result = qcf.createQueueConnection();
}
try
{
if (clientID != null)
result.setClientID(clientID);