Package net.grinder.communication

Examples of net.grinder.communication.MessageDispatchRegistry


        synchronized (m_agentMap) {
          purge(m_agentMap);
        }
      }
    }, 0, FLUSH_PERIOD);
    final MessageDispatchRegistry messageDispatchRegistry = consoleCommunication.getMessageDispatchRegistry();

    messageDispatchRegistry.set(AgentControllerProcessReportMessage.class,
        new AbstractHandler<AgentControllerProcessReportMessage>() {
          public void handle(AgentControllerProcessReportMessage message) {
            addAgentStatusReport(message);
          }
        });

    messageDispatchRegistry.set(LogReportGrinderMessage.class, new AbstractHandler<LogReportGrinderMessage>() {
      public void handle(final LogReportGrinderMessage message) {
        m_logListeners.apply(new Informer<LogArrivedListener>() {
          @Override
          public void inform(LogArrivedListener listener) {
            listener.logArrived(message.getTestId(), message.getAddress(), message.getLogs());
          }
        });
      }
    });

    messageDispatchRegistry.set(AgentDownloadGrinderMessage.class, new AbstractHandler<AgentDownloadGrinderMessage>() {
      public void handle(final AgentDownloadGrinderMessage message) {
        final AgentUpdateGrinderMessage agentUpdateGrinderMessage = m_agentDownloadListener.onAgentDownloadRequested(message.getVersion(), message.getNext());
        m_consoleCommunication.sendToAddressedAgents(message.getAddress(), agentUpdateGrinderMessage);
      }
    });
View Full Code Here


     * @param dispatchClientCommands  Client command dispatcher.
     */
    public WireMessageDispatch(ConsoleCommunication communication, final SampleModel model,
            final SampleModelViews sampleModelViews, DispatchClientCommands dispatchClientCommands) {

      final MessageDispatchRegistry messageDispatchRegistry = communication.getMessageDispatchRegistry();

      messageDispatchRegistry.set(RegisterTestsMessage.class, new AbstractHandler<RegisterTestsMessage>() {
        public void handle(RegisterTestsMessage message) {
          model.registerTests(message.getTests());
        }
      });

      messageDispatchRegistry.set(ReportStatisticsMessage.class, new AbstractHandler<ReportStatisticsMessage>() {
        public void handle(ReportStatisticsMessage message) {
          model.addTestReport(message.getStatisticsDelta());
        }
      });

      messageDispatchRegistry.set(RegisterExpressionViewMessage.class,
              new AbstractHandler<RegisterExpressionViewMessage>() {
                public void handle(RegisterExpressionViewMessage message) {
                  sampleModelViews.registerStatisticExpression(message.getExpressionView());
                }
              });
View Full Code Here

TOP

Related Classes of net.grinder.communication.MessageDispatchRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.