Class ConcurrentAuthorityFactory.DataAccessRef<DAO extends GeodeticAuthorityFactory>

java.lang.Object
org.apache.sis.referencing.factory.ConcurrentAuthorityFactory.DataAccessRef<DAO>
Enclosing class:
ConcurrentAuthorityFactory<DAO extends GeodeticAuthorityFactory>

private static final class ConcurrentAuthorityFactory.DataAccessRef<DAO extends GeodeticAuthorityFactory> extends Object
Holds the reference to a Data Access Object used by ConcurrentAuthorityFactory, together with information about its usage. In a mono-thread application, there is typically only one DataAccessRef instance at a given time. However if more than one than one thread are requesting new objects concurrently, then many instances may exist for the same ConcurrentAuthorityFactory.

If the Data Access Object is currently in use, then DataAccessRef counts how many recursive invocations of a factory createFoo(String) method is under way in the current thread. This information is used in order to reuse the same factory instead of creating new instances when a GeodeticAuthorityFactory implementation invokes itself indirectly through the ConcurrentAuthorityFactory. This assumes that factory implementations are reentrant.

If the Data Access Object has been released, then DataAccessRef keep the release timestamp. This information is used for prioritize the Data Access Objects to close.