@Test public void build_shouldUseADifferentLockForEachConstructedOpsLogger() throws Exception { BasicOpsLogger<TestMessages> firstResult = factory.build(infrastructure); BasicOpsLogger<TestMessages> secondResult = factory.build(infrastructure); assertNotNull(firstResult.getLock()); assertNotNull(secondResult.getLock()); assertNotEquals(firstResult.getLock(), secondResult.getLock()); }
public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); }
BasicOpsLoggerFactory { public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); } }
BasicOpsLoggerFactory { public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); }  }
BasicOpsLoggerFactory { public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); }  BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory); }
BasicOpsLoggerFactory { public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); }  BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory);  }