@Test public void closeQueueOnceOnly() { writer.close(); writer.close(); verify(mockChronicleQueue, times(1)).close(); }
@Override public synchronized void close() { if (!active) { return; } active = false; try { writerThread.interrupt(); writerThread.join(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } chronicle.close(); }
ChronicleWriter implements AutoCloseable { @Override public synchronized void close() { if (!active) { return; } active = false; try { writerThread.interrupt(); writerThread.join(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } chronicle.close(); } }
ChronicleWriter implements AutoCloseable { @Override public synchronized void close() { if (!active) { return; } active = false; try { writerThread.interrupt(); writerThread.join(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } chronicle.close(); } ChronicleWriter(ChronicleAuditLoggerConfig config); @VisibleForTesting  ChronicleWriter(ChronicleQueue chronicle); }
ChronicleWriter implements AutoCloseable { @Override public synchronized void close() { if (!active) { return; } active = false; try { writerThread.interrupt(); writerThread.join(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } chronicle.close(); } ChronicleWriter(ChronicleAuditLoggerConfig config); @VisibleForTesting  ChronicleWriter(ChronicleQueue chronicle); @Override synchronized void close(); }
ChronicleWriter implements AutoCloseable { @Override public synchronized void close() { if (!active) { return; } active = false; try { writerThread.interrupt(); writerThread.join(500); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } chronicle.close(); } ChronicleWriter(ChronicleAuditLoggerConfig config); @VisibleForTesting  ChronicleWriter(ChronicleQueue chronicle); @Override synchronized void close();  }