if (jtaTransactionManager != null) { return new SpringEndpoint(messageListener, xaResource, jtaTransactionManager); } else if (transactionManager != null) {
if (transactionManager != null) {
    public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {        MessageListener messageListener = createMessageListener();        xaResource = wrapXAResource(xaResource);        if (jtaTransactionManager != null) {            return new SpringEndpoint(messageListener, xaResource, jtaTransactionManager);        } else if (transactionManager != null) {            return new XAEndpoint(messageListener, xaResource, transactionManager);        }        else if (xaResource instanceof LocalTransaction) {            return new LocalTransactionEndpoint(messageListener, (LocalTransaction) xaResource);        }        return new AcknowledgeEndpoint(messageListener);    }