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);
}
});