ispnCache.start();
// Plug user-defined cache loader into adaptor
CacheLoader<K,? extends V> cacheLoader = c.getCacheLoader();
if (cacheLoader != null) {
CacheLoaderManager loaderManager =
ispnCache.getComponentRegistry().getComponent(CacheLoaderManager.class);
JCacheLoaderAdapter ispnCacheLoader =
(JCacheLoaderAdapter) loaderManager.getCacheLoader();
ispnCacheLoader.setCacheLoader(cacheLoader);
}
// Plug user-defined cache writer into adaptor
CacheWriter<? super K,? super V> cacheWriter = c.getCacheWriter();
if (cacheWriter != null) {
CacheLoaderManager loaderManager =
ispnCache.getComponentRegistry().getComponent(CacheLoaderManager.class);
JCacheWriterAdapter ispnCacheStore =
(JCacheWriterAdapter) loaderManager.getCacheStore();
ispnCacheStore.setCacheWriter(cacheWriter);
}
JCacheNotifier<K, V> notifier = new JCacheNotifier<K, V>();
cache = new JCache<K, V>(ispnCache, this, notifier, c);