@Test public void testStoreElement() { CacheElement<String> cacheElement = new CacheElementImpl<>("TEST", false); cacheProvider.storeInItemCache("testKey", cacheElement); CacheElement<String> fromCache = cacheProvider.loadPayloadFromLocalCache("testKey"); assertNotNull(fromCache); assertEquals(fromCache.getPayload(), "TEST"); assertFalse(fromCache.isExpired()); assertFalse(fromCache.isNull()); }
@Override protected <T> void storeElement(final String key, final CacheElement<T> cacheElement) { if (!isEnabled()) { return; } if (cache.containsKey(key)) { cache.replace(key, cacheElement); LOG.debug("Replaced item with key:{} in cache.", key); } else { cache.put(key, cacheElement); LOG.debug("Added item with key:{} in cache.", key); } }
EHCache3Provider extends AbstractEHCacheProvider implements PayloadCacheProvider, CacheInvalidator { @Override protected <T> void storeElement(final String key, final CacheElement<T> cacheElement) { if (!isEnabled()) { return; } if (cache.containsKey(key)) { cache.replace(key, cacheElement); LOG.debug("Replaced item with key:{} in cache.", key); } else { cache.put(key, cacheElement); LOG.debug("Added item with key:{} in cache.", key); } } }
EHCache3Provider extends AbstractEHCacheProvider implements PayloadCacheProvider, CacheInvalidator { @Override protected <T> void storeElement(final String key, final CacheElement<T> cacheElement) { if (!isEnabled()) { return; } if (cache.containsKey(key)) { cache.replace(key, cacheElement); LOG.debug("Replaced item with key:{} in cache.", key); } else { cache.put(key, cacheElement); LOG.debug("Added item with key:{} in cache.", key); } } EHCache3Provider(); }
EHCache3Provider extends AbstractEHCacheProvider implements PayloadCacheProvider, CacheInvalidator { @Override protected <T> void storeElement(final String key, final CacheElement<T> cacheElement) { if (!isEnabled()) { return; } if (cache.containsKey(key)) { cache.replace(key, cacheElement); LOG.debug("Replaced item with key:{} in cache.", key); } else { cache.put(key, cacheElement); LOG.debug("Added item with key:{} in cache.", key); } } EHCache3Provider(); @Override void flush(); @Override void invalidate(final String key); @Override CacheElement<T> loadPayloadFromLocalCache(final String key); @Override void storeInItemCache(final String key, final CacheElement<T> cacheElement, final
    List<CacheDependency> dependencies); @Override void addDependency(final String cacheKey, final String dependencyKey); Cache getCache(); Cache getDependencyCache(); }
EHCache3Provider extends AbstractEHCacheProvider implements PayloadCacheProvider, CacheInvalidator { @Override protected <T> void storeElement(final String key, final CacheElement<T> cacheElement) { if (!isEnabled()) { return; } if (cache.containsKey(key)) { cache.replace(key, cacheElement); LOG.debug("Replaced item with key:{} in cache.", key); } else { cache.put(key, cacheElement); LOG.debug("Added item with key:{} in cache.", key); } } EHCache3Provider(); @Override void flush(); @Override void invalidate(final String key); @Override CacheElement<T> loadPayloadFromLocalCache(final String key); @Override void storeInItemCache(final String key, final CacheElement<T> cacheElement, final
    List<CacheDependency> dependencies); @Override void addDependency(final String cacheKey, final String dependencyKey); Cache getCache(); Cache getDependencyCache();  }