How can be the StorageAccess optional? IIUC this is the only interface to store/retrieve data to/from Query region; QueryResultsRegion, DirectAccessRegion nor Region expose any put/get-like methods. Or do you expect implementors to implement/override CacheImplementor and QueryResultRegionAccess?
Well first... a cache provider would never ever ever implement CacheImplementor... that is Hibernate's internal caching service as an extension of JPA's javax.persistence.Cache. Beyond that, take a step back and look at the larger picture... There is an actual "caching SPI" that a provider must implement. It is made up of the contracts in org.hibernate.cache.spi and org.hibernate.cache.spi.access packages. As I keep saying, org.hibernate.cache.spi.support is a potential way, based on the pattern of templating, for providers to do that. If you want to use that templating approach, then you live by the tenets of that approach (whose main goal is to simplify provider implementations based on this StorageAccess contract and others. But you are completely free to implement caching support without a single reference to anything in org.hibernate.cache.spi.support - that kind of makes it optional by definition  |