@Test public void build_shouldUseANewLinkedTransferQueueForEachConstructedOpsLogger() throws Exception { AsyncOpsLogger<TestMessages> firstResult = factory.build(infrastructure); AsyncOpsLogger<TestMessages> secondResult = factory.build(infrastructure); assertNotNull(firstResult.getTransferQueue()); assertNotNull(secondResult.getTransferQueue()); assertNotSame(firstResult, secondResult); }
public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); } }
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }  }
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }  AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory); }
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }  AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory);  }