Class CachedAuthorityDecorator

All Implemented Interfaces:
AuthorityFactory, CRSAuthorityFactory, CSAuthorityFactory, DatumAuthorityFactory, Factory, CoordinateOperationAuthorityFactory, BufferedFactory, Factory, RegistrableFactory

An authority factory that caches all objects created by delegate factories. This class is set up to cache the full complement of referencing objects: In many cases a single implementation will be used for several the authority factory interfaces - but this is not a requirement. The behaviour of the createFoo(String) methods first looks if a previously created object exists for the given code. If such an object exists, it is returned directly. The testing of the cache is synchronized and may block if the referencing object is under construction.

If the object is not yet created, the definition is delegated to the appropriate the AuthorityFactory authority factory and the result is cached for next time.

This object is responsible for owning a {{ReferencingObjectCache}}; there are several implementations to choose from on construction.

Since:
2.4
Author:
Jody Garnett