if (jtaTransactionManager != null) { endpointFactory = new DefaultEndpointFactory(beanFactory, ref, jtaTransactionManager, getName()); } else if (transactionManager != null) {
if (transactionManager != null) {
    public void afterPropertiesSet() throws Exception {        if (activationSpec == null) {            throw new IllegalArgumentException("activationSpec must be set");        }        ResourceAdapter temp = activationSpec.getResourceAdapter();        if (temp == null && resourceAdapter != null) {            activationSpec.setResourceAdapter(resourceAdapter);        }        else if (resourceAdapter == null) {            resourceAdapter = activationSpec.getResourceAdapter();            if (resourceAdapter == null) {                throw new IllegalArgumentException("resourceAdapter property must be set on the activationSpec object");            }        }        if (bootstrapContext == null) {            throw new IllegalArgumentException("bootstrapContext must be set");        }        if (endpointFactory == null) {            if (ref == null) {                throw new IllegalArgumentException("either the endpointFactory or ref properties must be set");            }            if (jtaTransactionManager != null) {                endpointFactory = new DefaultEndpointFactory(beanFactory, ref, jtaTransactionManager, getName());            } else if (transactionManager != null) {                endpointFactory = new DefaultEndpointFactory(beanFactory, ref, transactionManager, getName());            }            else {                // TODO should we have some way of finding a ManagedConnection or other local transaction hook?                endpointFactory = new DefaultEndpointFactory(beanFactory, ref);            }        }        log.info("Activating endpoint for activationSpec: " + activationSpec + " using endpointFactory: " + endpointFactory);        resourceAdapter.endpointActivation(endpointFactory, activationSpec);    }