routed = true;
Delivery del = queue.handle(null, ref, tx);  if (del != null && del.isSelectorAccepted()) { routed = true; }
   public boolean route(MessageReference ref, String condition, Transaction tx) throws Exception   {      if (ref == null)      {         throw new IllegalArgumentException("Message reference is null");      }            if (condition == null)      {         throw new IllegalArgumentException("Condition key is null");      }            boolean routed = false;            lock.readLock().acquire();                      try      {                          ConditionBindings cb = (ConditionBindings)conditionMap.get(condition);                                      if (cb != null)         {                        boolean startInternalTx = false;                        if (tx == null && ref.isReliable())            {               if (cb.getDurableCount() > 1)               {                  // When routing a persistent message without a transaction then we may need to start an                   // internal transaction in order to route it.                  // This is so we can guarantee the message is delivered to all or none of the subscriptions.                  // We need to do this if there is more than one durable sub                  startInternalTx = true;               }            }                        if (startInternalTx)            {               tx = tr.createTransaction();            }                                    List bindings = cb.getAllBindings();                        Iterator iter = bindings.iterator();                        while (iter.hasNext())            {               Binding binding = (Binding)iter.next();                                if (binding.isActive() && binding.getNodeId().equals(this.nodeId))               {                  //It's a local binding so we pass the message on to the subscription                  Queue subscription = binding.getQueue();                                 Delivery del = subscription.handle(null, ref, tx);                                    if (del != null && del.isSelectorAccepted())                  {                     routed = true;                  }                                 }                           }                         if (startInternalTx)            {               //TODO - do we need to rollback if an exception is thrown??               tx.commit();            }         }                          return routed;      }      finally      {                           lock.readLock().release();      }   } 