log.info(this + " got routable:" + ref);
log.trace(this + " got routable:" + ref);
   public Delivery handle(DeliveryObserver observer, MessageReference ref, Transaction tx)   {      log.info(this + " got routable:" + ref);            try      {         if (ref == null)         {            log.info("Receiver [" + name + "] is rejecting a null reference");            return null;         }                  if (SELECTOR_REJECTING.equals(state))         {            log.info(this + " is rejecting message since doesn't match selector");            return new SimpleDelivery(null, null, true, false);         }         if (REJECTING.equals(state))         {            log.info(this + " is rejecting reference " + ref);            return null;         }         if (BROKEN.equals(state))         {            throw new RuntimeException("THIS IS AN EXCEPTION THAT SIMULATES "+                                       "THE BEHAVIOUR OF A BROKEN RECEIVER");         }        log.info("State is:" + state);                  boolean done = ACKING.equals(state) ? true : false;         log.info(this + " is " + (done ? "ACKing" : "NACKing") +  " message " + ref);                  Message m = ref.getMessage();                  SimpleDelivery delivery = new SimpleDelivery(observer, ref, done);         messages.add(new Object[] {m, done ? null : delivery});         if (immediateAsynchronousAcknowledgment)         {            log.info("simulating an asynchronous ACK that arrives before we return the delivery to channel");            try            {               delivery.acknowledge(null);            }            catch(Throwable t)            {               log.error("Cannot acknowledge", t);            }         }         return delivery;      }      finally      {         synchronized(waitingArea)         {            if (futureState != null && --invocationsToFutureStateCount == 0)            {               state = futureState;               futureState = null;            }            Integer crt = (Integer)waitingArea.get(INVOCATION_COUNT);            waitingArea.put(INVOCATION_COUNT, new Integer(crt.intValue() + 1));            waitingArea.notifyAll();         }      }   }