jsr107/jsr107spec — Issue #41: Registration of cacheloaders should change to use something other than instance
Author: yannis666
Created: 2011-11-18 22:22:20+00:00
State: open

In a distributed implementation of a cache, operations which may need invocation of a CacheLoader could occur on an arbitrary node. The current method of specifying CacheLoaders uses the CacheBuilder, providing an instance, which causes dificulty in efficiently implementing this.
An added bonus is this is more sympathetic to (unspecified) configuration through XML.

A solution could be to change the signature to something like

/**
* Sets the cache loader.
*
* @param cacheLoaderClass the CacheLoader class. The class must have a public no args constructor.
* @return the builder
* @throws NullPointerException if cacheLoaderClass is null.
*/
CacheBuilder setCacheLoader(Class> cacheLoaderClass);

I have temporarily added such an api with name setCacheLoaderNew