Class RepositorySystemSupplier

All Implemented Interfaces:

public class RepositorySystemSupplier extends Object implements Supplier<RepositorySystem>
A simple memorizing Supplier of RepositorySystem instance, that on first call supplies lazily constructed instance, and on each subsequent call same instance. Hence, this instance should be thrown away immediately once repository system was created and there is no need for more instances. If new repository system instance needed, new instance of this class must be created. For proper shut down of returned repository system instance(s) use RepositorySystem.shutdown() method on supplied instance(s).

Since Resolver 2.0 this class offers access to various components via public getters, and allows even partial object graph construction.

Extend this class createXXX() methods and override to customize, if needed. The contract of this class makes sure that these (potentially overridden) methods are invoked only once, and instance created by those methods are memorized and kept as long as supplier instance is kept open.

This class is not thread safe and must be used from one thread only, while the constructed RepositorySystem is thread safe.

Important: Given the instance of supplier memorizes the supplier RepositorySystem instance it supplies, their lifecycle is shared as well: once supplied repository system is shut-down, this instance becomes closed as well. Any subsequent getXXX method invocation attempt will fail with IllegalStateException.