The method produces only meaningful results if the cache is not typed. The JavaDoc says:
* Implementations must check if key and value types were configured
* for the requested {@link Cache}. If either the keyType or valueType of the
* configured {@link Cache} were specified (other than <code>Object.class</code>)
* an {@link IllegalArgumentException} will be thrown.
The signature of the method is:
<K, V> Cache<K, V> getCache(String cacheName);
It should be:
Cache getCache(String cacheName);
Maybe this is possible to fix for 1.1?! I am not quite sure....
Side note:
There is a another problem with the semantic definition. The cache manager iterates the cache names. There is a chicken and egg problem. If you do not know the proper types, it is not possible to retrieve a cache. If you have a cache, you can retrieve the configured types by cache.getConfiguration().
The method produces only meaningful results if the cache is not typed. The JavaDoc says:
The signature of the method is:
It should be:
Maybe this is possible to fix for 1.1?! I am not quite sure....
Side note: There is a another problem with the semantic definition. The cache manager iterates the cache names. There is a chicken and egg problem. If you do not know the proper types, it is not possible to retrieve a cache. If you have a cache, you can retrieve the configured types by
cache.getConfiguration()
.