private void ensureConnectionFactory() {
if (connectionFactory == null) {
synchronized (this) {
if (connectionFactory == null) {
if (service.connectionFactory == null) {
connectionFactory = new DefaultConnectionFactory();
} else {
try {
connectionFactory = InitialContext.doLookup(service.connectionFactory);
} catch (NamingException e) {
throw new IllegalArgumentException("Failed to lookup connection factory", e);