@Override public boolean insert(final IMonitoringRecord element) { this.writer.writeMonitoringRecord(element); return true; }
@Override public boolean insert(final IMonitoringRecord element) { this.writer.writeMonitoringRecord(element); return true; }
public static void writeMonitoringRecords(final AbstractMonitoringWriter writer, final int numRecords, final EmptyRecord record) { for (int i = 0; i < numRecords; i++) { writer.writeMonitoringRecord(record); } }
@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."); } }