class ConsoleListener {

  public void registerMessageHandlers(
    MessageDispatchRegistry messageDispatcher) {

    messageDispatcher.set(
      StartGrinderMessage.class,
      new AbstractMessageHandler<StartGrinderMessage>() {
        public void handle(StartGrinderMessage message) {
          m_logger.info("received a start message");
          m_lastStartGrinderMessage = message;
          setReceived(START);
        }
      });

    messageDispatcher.set(
      StopGrinderMessage.class,
      new AbstractMessageHandler<StopGrinderMessage>() {
        public void handle(StopGrinderMessage message) {
          m_logger.info("received a stop message");
          setReceived(STOP);
        }
      });

    messageDispatcher.set(
      ResetGrinderMessage.class,
      new AbstractMessageHandler<ResetGrinderMessage>() {
        public void handle(ResetGrinderMessage message) {
          m_logger.info("received a reset message");
          setReceived(RESET);
        }
      });
  }

  public  ConsoleListener(Condition notifyOnMessage, Logger logger);

}