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