@Test public void testCreatingCacheInRuntime() { final CachingProvider cachingProvider = Caching.getCachingProvider(); final CacheManager cacheManager = cachingProvider.getCacheManager(); String cacheName = "nonExistingCache"; assertNull(cacheManager.getCache(cacheName)); Configuration configuration = new JCacheConfiguration(new MutableConfiguration()); cacheManager.createCache(cacheName, configuration); final Cache<Object, Object> sampleCache = cacheManager.getCache(cacheName); assertNotNull(sampleCache); sampleCache.put("key", "value"); final Ehcache unwrapped = sampleCache.unwrap(Ehcache.class); final Element element = unwrapped.get("key"); assertEquals("value", element.getObjectValue()); assertThat(element.isEternal(), is(true)); assertThat(element.getTimeToIdle(), is(0)); assertThat(element.getTimeToLive(), is(0)); }
@Override public CacheManager getCacheManager() { return getCacheManager(getDefaultURI(), getDefaultClassLoader()); }
JCacheCachingProvider implements CachingProvider { @Override public CacheManager getCacheManager() { return getCacheManager(getDefaultURI(), getDefaultClassLoader()); } }
JCacheCachingProvider implements CachingProvider { @Override public CacheManager getCacheManager() { return getCacheManager(getDefaultURI(), getDefaultClassLoader()); }  }
JCacheCachingProvider implements CachingProvider { @Override public CacheManager getCacheManager() { return getCacheManager(getDefaultURI(), getDefaultClassLoader()); }  @Override CacheManager getCacheManager(); @Override CacheManager getCacheManager(final URI uri, final ClassLoader classLoader); @Override CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties); @Override ClassLoader getDefaultClassLoader(); @Override URI getDefaultURI(); @Override Properties getDefaultProperties(); @Override void close(); @Override void close(final ClassLoader classLoader); @Override void close(final URI uri, final ClassLoader classLoader); @Override boolean isSupported(final OptionalFeature optionalFeature); }
JCacheCachingProvider implements CachingProvider { @Override public CacheManager getCacheManager() { return getCacheManager(getDefaultURI(), getDefaultClassLoader()); }  @Override CacheManager getCacheManager(); @Override CacheManager getCacheManager(final URI uri, final ClassLoader classLoader); @Override CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties); @Override ClassLoader getDefaultClassLoader(); @Override URI getDefaultURI(); @Override Properties getDefaultProperties(); @Override void close(); @Override void close(final ClassLoader classLoader); @Override void close(final URI uri, final ClassLoader classLoader); @Override boolean isSupported(final OptionalFeature optionalFeature);  }