class MessageDispatchSender implements Sender, MessageDispatchRegistry {

  public void shutdown() {
    final List<Handler<? extends Message>> handlers;

    synchronized (m_handlers) {
      handlers = new ArrayList<Handler<? extends Message>>(m_handlers.values());
    }

    for (Handler<? extends Message> handler : handlers) {
      handler.shutdown();
    }

    final List<BlockingHandler<? extends Message>> responders;

    synchronized (m_responders) {
      responders =
        new ArrayList<BlockingHandler<? extends Message>>(
            m_responders.values());
    }

    for (BlockingHandler<? extends Message> responder : responders) {
      responder.shutdown();
    }

    m_fallbackHandlers.apply(new ListenerSupport.Informer<Handler<Message>>() {
      public void inform(Handler<Message> handler) { handler.shutdown(); }
    });
  }

}