@Test public void testGet() throws Exception { Ehcache ehcache = new net.sf.ehcache.Cache("testGet", 10, true, false, 500, 200); manager.addCache(ehcache); JCache jcache = new JCache(manager.getCache("sampleCache1")); CountingCacheLoader specificCacheLoader = new CountingCacheLoader(); specificCacheLoader.setName("SpecificCacheLoader"); jcache.put("key", "dog"); Object value = jcache.get("key"); assertEquals("dog", value); CountingCacheLoader countingCacheLoader = new CountingCacheLoader(); jcache.setCacheLoader(countingCacheLoader); value = jcache.get("key"); assertEquals("dog", value); countingCacheLoader = new CountingCacheLoader(); jcache.setCacheLoader(countingCacheLoader); value = jcache.get("key", "1"); assertEquals("dog", value); jcache.remove("key"); jcache.setCacheLoader(null); jcache.put("key", null); value = jcache.get("key"); assertNull(value); jcache.remove("key"); jcache.setCacheLoader(null); jcache.put("key", null); value = jcache.get("key", "loaderArgument"); assertNull(value); jcache.remove("key"); jcache.setCacheLoader(countingCacheLoader); value = jcache.get("key"); assertEquals(new Integer(0), value); jcache.remove("key"); value = jcache.get("key"); assertEquals(new Integer(1), value); jcache.remove("key"); jcache.setCacheLoader(countingCacheLoader); value = jcache.get("key", new CountingCacheLoader()); assertEquals(new Integer(0), value); jcache.remove("key"); jcache.setCacheLoader(countingCacheLoader); value = jcache.get("key", "argumentValue"); assertEquals("CountingCacheLoader:argumentValue", value); jcache.remove("key"); jcache.setCacheLoader(countingCacheLoader); value = jcache.get("key", specificCacheLoader, "argumentValue"); assertEquals("SpecificCacheLoader:argumentValue", value); jcache.remove("key"); jcache.setCacheLoader(countingCacheLoader); value = jcache.get("key", "argumentValue"); assertEquals("CountingCacheLoader:argumentValue", value); jcache.put("key2", "value"); value = jcache.get("key2"); assertEquals("value", value); }
public Object get(Object key) throws RuntimeException { return get(key, null); }
JCache implements net.sf.jsr107cache.Cache { public Object get(Object key) throws RuntimeException { return get(key, null); } }
JCache implements net.sf.jsr107cache.Cache { public Object get(Object key) throws RuntimeException { return get(key, null); } JCache(Ehcache cache);  JCache(Ehcache cache, net.sf.jsr107cache.CacheLoader cacheLoader);  JCache(Ehcache cache, JCacheLoader cacheLoader); }
JCache implements net.sf.jsr107cache.Cache { public Object get(Object key) throws RuntimeException { return get(key, null); } JCache(Ehcache cache);  JCache(Ehcache cache, net.sf.jsr107cache.CacheLoader cacheLoader);  JCache(Ehcache cache, JCacheLoader cacheLoader); void setCacheLoader(JCacheLoader cacheLoader); void addListener(CacheListener cacheListener); void evict(); Map getAll(Collection keys); Map getAll(Collection keys, Object loaderArgument); CacheLoader getCacheLoader(); CacheEntry getCacheEntry(Object key); CacheStatistics getCacheStatistics(); void load(final Object key); void loadAll(final Collection keys); void loadAll(final Collection keys, final Object loaderArgument); Object peek(Object key); void removeListener(CacheListener cacheListener); int size(); boolean isEmpty(); boolean containsKey(Object key); boolean containsValue(Object value); Object get(Object key); Object get(Object key, Object loaderArgument); Object get(Object key, JCacheLoader loader); Object get(Object key, JCacheLoader loader, Object loaderArgument); Object put(Object key, Object value); Object put(Object key, Object value, int timeToLiveSeconds); Object remove(Object key); void putAll(Map sourceMap); void clear(); Set keySet(); Collection values(); Set entrySet(); void setStatisticsAccuracy(int statisticsAccuracy); Ehcache getBackingCache(); String toString(); }
JCache implements net.sf.jsr107cache.Cache { public Object get(Object key) throws RuntimeException { return get(key, null); } JCache(Ehcache cache);  JCache(Ehcache cache, net.sf.jsr107cache.CacheLoader cacheLoader);  JCache(Ehcache cache, JCacheLoader cacheLoader); void setCacheLoader(JCacheLoader cacheLoader); void addListener(CacheListener cacheListener); void evict(); Map getAll(Collection keys); Map getAll(Collection keys, Object loaderArgument); CacheLoader getCacheLoader(); CacheEntry getCacheEntry(Object key); CacheStatistics getCacheStatistics(); void load(final Object key); void loadAll(final Collection keys); void loadAll(final Collection keys, final Object loaderArgument); Object peek(Object key); void removeListener(CacheListener cacheListener); int size(); boolean isEmpty(); boolean containsKey(Object key); boolean containsValue(Object value); Object get(Object key); Object get(Object key, Object loaderArgument); Object get(Object key, JCacheLoader loader); Object get(Object key, JCacheLoader loader, Object loaderArgument); Object put(Object key, Object value); Object put(Object key, Object value, int timeToLiveSeconds); Object remove(Object key); void putAll(Map sourceMap); void clear(); Set keySet(); Collection values(); Set entrySet(); void setStatisticsAccuracy(int statisticsAccuracy); Ehcache getBackingCache(); String toString();  }