@Override public Object resolve(Context c, Map<String, String[]> parameters, Map<String, InputStream> dataStreams) throws JSONException { EwCache<Object,Object> cache = EwCache.getCache("CruncherCache", 5000); String threadId = parameters.get("threadId")[0]; String name = getAsString("obj", c, parameters, dataStreams); return cache.get(threadId+name); }
public static synchronized EwCache<Object, Object> getCache(String name, int count) { if (!cache) return null; SoftReference<EwCache<Object, Object>> cache = caches.get(name); EwCache<Object, Object> cacheActual; if (cache != null) if ((cacheActual = cache.get()) != null) return cacheActual; System.out.println("Creating cache: " + name); caches.put(name, new SoftReference<EwCache<Object, Object>>(cacheActual = new EwCache<Object, Object>(count))); return cacheActual; }
result = EwCache.getCache("GlobalCache").get(cacheName); } else { result = c.get(cacheName);