@Override public void run() { LOGGER.debug("{} is running.", this.getClass().getName()); this.writer.onStarting(); try { IMonitoringRecord record = this.writerQueue.take(); while (record != END_OF_MONITORING_RECORD) { // NOPMD (compare references by == not by equals()) this.writer.writeMonitoringRecord(record); record = this.writerQueue.take(); } } catch (final InterruptedException e) { LOGGER.debug("{} was interrupted.", this.getClass().getName(), e); // do nothing; the thread terminates itself } this.writer.onTerminating(); LOGGER.debug("{} has finished.", this.getClass().getName()); }
@Override public void run() { if (LOG.isDebugEnabled()) { LOG.debug(this.getClass().getName() + " is running."); } this.writer.onStarting(); try { IMonitoringRecord record = this.writerQueue.take(); while (record != END_OF_MONITORING_RECORD) { // NOPMD (compare references by == not by equals()) this.writer.writeMonitoringRecord(record); record = this.writerQueue.take(); } } catch (final InterruptedException e) { if (LOG.isDebugEnabled()) { LOG.debug(this.getClass().getName() + " was interrupted.", e); } // do nothing; the thread terminates itself } this.writer.onTerminating(); if (LOG.isDebugEnabled()) { LOG.debug(this.getClass().getName() + " has finished."); } }
public static <W extends AbstractMonitoringWriter & IFileWriter> File executeFileWriterTest(final int numRecordsToWrite, final W writer, final EmptyRecord record) { writer.onStarting(); FilesystemTestUtil.writeMonitoringRecords(writer, numRecordsToWrite, record); writer.onTerminating(); return writer.getLogFolder().toFile(); }