Package software.xdev.tci.factory
Class BaseTCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>
java.lang.Object
software.xdev.tci.factory.BaseTCIFactory<C,I>
- All Implemented Interfaces:
AutoCloseable,TCIFactory<C,I>
- Direct Known Subclasses:
OnDemandTCIFactory,PreStartableTCIFactory
public abstract class BaseTCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>
extends Object
implements TCIFactory<C,I>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseTCIFactory(BiFunction<C, String, I> infraBuilder, Supplier<C> containerBuilder, String containerBaseName, String containerLoggerName) -
Method Summary
Modifier and TypeMethodDescriptionprotected Cvoidclose()protected static org.testcontainers.containers.output.Slf4jLogConsumergetLogConsumer(String name) protected voidhandleInfraStartFail(I infra) protected org.slf4j.Loggerlog()protected IregisterReturned(I infra) voidsetGetNewTryCount(int getNewTryCount) voidwarmUp()Does some warm up work, e.g. building images so that they don't have to be pulled later.protected voidprotected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.xdev.tci.factory.TCIFactory
getFactoryName, register, unregister
-
Field Details
-
returnedAndInUse
-
warmedUp
protected boolean warmedUp -
getNewTryCount
protected int getNewTryCountDescribes how often new infra should be created/started - if it fails.This helps with "Random" errors that occur during infra startup. For example when a port allocation fails.
-
infraBuilder
-
containerBuilder
-
containerBaseName
-
containerLoggerName
-
tracer
-
-
Constructor Details
-
BaseTCIFactory
-
-
Method Details
-
warmUp
public void warmUp()Description copied from interface:TCIFactoryDoes some warm up work, e.g. building images so that they don't have to be pulled later. -
warmUpSync
protected void warmUpSync() -
warmUpInternal
protected void warmUpInternal() -
buildContainer
-
handleInfraStartFail
-
registerReturned
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>
-
getReturnedAndInUse
- Specified by:
getReturnedAndInUsein interfaceTCIFactory<C extends org.testcontainers.containers.GenericContainer<C>,I extends TCI<C>>
-
getTracer
-
setGetNewTryCount
public void setGetNewTryCount(int getNewTryCount) -
log
protected org.slf4j.Logger log() -
getLogConsumer
-