if (trace) { log.trace("sending " + r + " to the core destination " + jbDest.getName() + (tx == null ? "": ", tx " + tx)); }
if (trace) { log.trace("sending " + m + (tx == null ? " non-transactionally" : " transactionally on " + tx + " to the core destination " + jbDest.getName())); }
   protected void sendMessage(JBossMessage m, Transaction tx) throws JMSException   {      if (trace) { log.trace("sending " + m + (tx == null ? " non-transactionally" : " transactionally on " + tx)); }      // The JMSDestination header must already have been set for each message      JBossDestination jbDest = (JBossDestination)m.getJMSDestination();      if (jbDest == null)      {         throw new IllegalStateException("JMSDestination header not set!");      }      CoreDestination coreDestination = channelMapper.getCoreDestination(jbDest);            if (coreDestination == null)      {         throw new JMSException("Destination " + jbDest.getName() + " does not exist");      }            //This allows the no-local consumers to filter out the messages that come from the      //same connection      //TODO Do we want to set this for ALL messages. Optimisation is possible here      m.setConnectionID(connectionID);            Routable r = (Routable)m;          if (trace) { log.trace("sending " + r + " to the core destination " + jbDest.getName() + (tx == null ? "": ", tx " + tx)); }            Delivery d = coreDestination.handle(null, r, tx);            // The core destination is supposed to acknowledge immediately. If not, there's a problem.      if (d == null || !d.isDone())      {         String msg = "The message was not acknowledged by destination " + coreDestination;         log.error(msg);         throw new JBossJMSException(msg);      }   }