final Queue queue = (Queue) _activation.getDestination();
_consumer = _session.createConsumer(queue, selector);
}
// Create the endpoint, if we are transacted pass the session so it is enlisted, unless using Local TX
MessageEndpointFactory endpointFactory = _activation.getMessageEndpointFactory();
_useLocalTx = _activation.getActivationSpec().isUseLocalTx();
_transacted = _activation.isDeliveryTransacted() || _useLocalTx ;
if (_activation.isDeliveryTransacted() && !_activation.getActivationSpec().isUseLocalTx())
{
final XAResource xaResource = ((XASession)_session).getXAResource() ;
_endpoint = endpointFactory.createEndpoint(xaResource);
}
else
{
_endpoint = endpointFactory.createEndpoint(null);
}
_consumer.setMessageListener(this);
}