throw new IllegalStateException("Thread interrupted while receiving");
m = null;
   protected MessageProxy getMessage(long timeout) throws JMSException   {      MessageProxy m = null;            // If it's receiveNoWait then get the message directly      if (timeout == -1)      {         m = getMessageNow();              }      else      {         // ... otherwise we activate the server side consumer and wait for a message to arrive         // asynchronously                  activateConsumer();               try         {                     if (timeout == 0)            {               //Wait for ever potentially               while (!closing && buffer.isEmpty())               {                  mainLock.wait();                              }            }            else            {               //Wait with timeout               long toWait = timeout;                            while (!closing && buffer.isEmpty() && toWait > 0)               {                  toWait = waitOnLock(mainLock, toWait);               }            }                         if (closing)            {               m = null;            }            else            {               if (!buffer.isEmpty())               {                  m = (MessageProxy)buffer.removeFirst();               }               else               {                  m = null;               }            }         }         catch (InterruptedException e)         {            //No one should be interrupting the thread so this shouldn't occur            throw new IllegalStateException("Thread interrupted while receiving");         }                  finally         {            // We only need to call this if we timed out                    if (m == null)            {               deactivateConsumer();            }                        }       }                     return m;   }