String password = jndiConfig.getConnectionPassword();
try {
ConnectionFactory cf = jmsConfig.getJndiTemplate().
lookup(connectionFactoryName, ConnectionFactory.class);
if (userName != null) {
UserCredentialsConnectionFactoryAdapter uccf = new UserCredentialsConnectionFactoryAdapter();
uccf.setUsername(userName);
uccf.setPassword(password);
uccf.setTargetConnectionFactory(cf);
cf = uccf;
}
return cf;
} catch (NamingException e) {