public void onNewSnapshot(@Observes @Severity(Severity.Level.HEARTBEAT) Snapshot snapshot) {
LOG.info("SnapshotEventBroker.oneNewSnapshot: " + snapshot.getId());
List<BrowserWindow> currentBrowsers = new ArrayList<>(browsers);
List<BrowserWindow> staging = new ArrayList<>(browsers.size());
AsyncMultiWriter multiWriter = new AsyncMultiWriter();
for (BrowserWindow browserWindow : currentBrowsers) {
if (browserWindow.getChannel() == null || browserWindow.getChannel().trim().isEmpty()) {
LOG.log(Level.INFO, "Found a browser window({0}) with no channel", browserWindow.hashCode());
}
if (snapshot.getInstanceName().equals(browserWindow.getChannel())) {
LOG.log(Level.FINEST, "Staging {0}", browserWindow.hashCode());
Writer writer = browserWindow.getWriter();
if (writer != null) {
multiWriter.addWriter(writer);
staging.add(browserWindow);
} else {
browsers.remove(browserWindow);
}
}