class ServerReceiver implements Receiver {

  public Message waitForMessage() throws CommunicationException {

    try {
      return m_messageQueue.dequeue(true);
    }
    catch (MessageQueue.ShutdownException e) {
      return null;
    }
  }

}