Hi there,
Is there any way to configure a cache whose value type is a generic using either the Ehcache or JCache APIs? In other words, I'd like to do something like the following:
public class BasicCache<T>
{
private void foo()
{
CachingProvider provider = Caching.getCachingProvider(fullyQualifiedProviderName);
CacheManager cacheManager = provider.getCacheManager();
configuration = new MutableConfiguration<String, T>() .setTypes(String.class, T.class)....
}
}
T.class is not permissible and from what I understand, there is no "good" workaround for it. (I'm a C# guy so ordinarily something like the above would be permissible.)
Is there any way possible to get around this limitation? Maybe it _is_ indeed possible and I am missing something?
As you might have guessed, I'm trying to write a wrapper around the API.
Ehcache 3.1; JDK 1.7
Thanks!