new MessagePump(m_receiver, handlerChainSender, 1);
final MessageDispatchSender messageDispatcher = new MessageDispatchSender(); m_consoleListener.registerMessageHandlers(messageDispatcher);    fileStoreMessageDispatcher.addFallback( new TeeSender(messageDispatcher, m_fanOutStreamSender));  new MessagePump(m_receiver, fileStoreMessageDispatcher, 1);
    public ConsoleCommunication(Connector connector)        throws CommunicationException, FileStore.FileStoreException {      m_receiver = ClientReceiver.connect(connector);      m_sender = ClientSender.connect(m_receiver);      m_sender.send(        new AgentProcessReportMessage(          m_agentIdentity,          AgentProcessReportMessage.STATE_STARTED));      if (m_fileStore == null) {        // Only create the file store if we connected.        m_fileStore =          new FileStore(            new File("./" + m_agentIdentity.getName() + "-file-store"),            m_logger);      }      // Ordering of the handlers is important.      final HandlerChainSender handlerChainSender =        new HandlerChainSender();      handlerChainSender.add(m_fileStore.getMessageHandler());      handlerChainSender.add(m_fanOutStreamSender);      handlerChainSender.add(m_consoleListener.getMessageHandler());      new MessagePump(m_receiver, handlerChainSender, 1);      m_reportRunningTask = new TimerTask() {        public void run() {          try {            m_sender.send(              new AgentProcessReportMessage(                m_agentIdentity,                AgentProcessReportMessage.STATE_RUNNING));          }          catch (CommunicationException e) {            cancel();          }        }      };      m_timer.schedule(m_reportRunningTask, 1000, 1000);    }