setListening(true);  if (log.isTraceEnabled()) { log.trace("set listening to true"); }
   public void run()   {      if (log.isTraceEnabled()) { log.trace("listener thread started"); }            setListening(true);            if (log.isTraceEnabled()) { log.trace("set listening to true"); }      try      {               while(true)         {                        if (log.isTraceEnabled()) { log.trace("clearing buffer"); }            clearBuffer();            // forward the invocation to the server, the server-side consumer delegate needs            // to know it must start accepting messages            forwardToServer(mi, this, receiverInterceptor);            if (log.isTraceEnabled()) { log.trace("blocking to take a message"); }            JBossMessage m = (JBossMessage)messages.take();            preDeliver(m);               listener.onMessage(m);            if (log.isTraceEnabled()) { log.trace("message successfully handled by listener"); }            postDeliver(m);                  }           }      catch(InterruptedException e)      {         log.debug("message listener thread interrupted, exiting");               }      catch(Throwable t)      {         // TODO - different actions for client error/commuication error         // TODO - try several times and then give up?         log.error(t);      }      finally      {               stopServerDelivery();         setListening(false);      }   }