} else { return get(key);
element = super.get(key); } else { Sync lock = getLockForKey(key);
@SuppressWarnings("unchecked") @Override public V get(K key) { V result = null; Element e = cache.get(key); if (e == null){ // cache miss logger.error("Cache miss should never happened in SelfPopulatingCache: {}", cache.getName()); }else{ // cache hit result = (V) e.getObjectValue(); triggerRefreshIfNeeded(e); } return result; }
public ClientHost getClientHost(String clientHostIP) { clientHostIP = clientHostIP == null ? "Unknown" : clientHostIP; Element elt = mClientHostCache.get(clientHostIP); return (ClientHost) elt.getObjectValue(); }
m = self.get(key); } catch (IllegalStateException err) { log.error("Cannot lookup " + key + " in \"" + self.getName() + "\"", err);
} else { return get(key);
public User getUser(String userName) { userName = userName == null ? "Anonymous" : userName; Element elt = mUserCache.get(userName); return (User) elt.getObjectValue(); }
m = self.get(key); } catch (IllegalStateException err) { log.error("Cannot lookup " + key + " in \"" + self.getName() + "\"", err);
} else { return get(key);
public DelayType getDelayType(int type) { Element elt = mDelayTypeCache.get(type); return (DelayType) elt.getObjectValue(); }
public HitResult getHitResult(int res) { Element elt = mHitResultCache.get(res); return (HitResult) elt.getObjectValue(); }
public Host getHost(String hostName, Environment env) { hostName = hostName == null ? "Undefined" : hostName; Element elt = mHostCache.get(new EnvHostKey(env, hostName)); return (Host) elt.getObjectValue(); }
public ApplicationVersion getApplicationVersion(String appCode, String versionName) { appCode = appCode == null ? "Undefined" : appCode; versionName = versionName == null ? "Undefined" : versionName; Element elt = mVersionCache.get(new AppVersionKey(appCode, versionName)); return (ApplicationVersion) elt.getObjectValue(); }
public Webapp getWebapp(String webappName, Application app) { webappName = webappName == null ? "Undefined" : webappName; Element elt = mWebappCache.get(new WebappKey(app, webappName)); return (Webapp) elt.getObjectValue(); }
public Environment getEnvironment(String orgCode, String envCode) { orgCode = orgCode == null ? "Undefined" : orgCode; envCode = envCode == null ? "Undefined" : envCode; Element elt = mEnvironmentCache.get(new OrgEnvKey(orgCode, envCode)); return (Environment) elt.getObjectValue(); }
public URL getURL(String urlName, Webapp webapp) { urlName = urlName == null ? "Undefined" : urlName; Element elt = mURLCache.get(new URLKey(webapp, urlName)); return (URL) elt.getObjectValue(); }
public Session getSession(String sessionCode, ApplicationVersion version, Environment env, User user, ClientHost clientHost) { Session result = null; if (sessionCode != null) { Element elt = mSessionCache.get(new SessionKey(sessionCode, version, env, user, clientHost)); result = (Session) elt.getObjectValue(); } return result; }
@Override public TermList getTermList(PortletRequest request) { final Serializable termListKey = coursesDao.getTermListKey(request); final CacheKey scopedKey = getScopedKey(termListKey); final Element element = this.termListCache.get(scopedKey); if (element == null) { return null; } return (TermList)element.getObjectValue(); }
@Override public CoursesByTerm getCoursesByTerm(PortletRequest request, String termCode) { final TermList termList = this.getTermList(request); final Serializable coursesByTermKey = coursesDao.getCoursesByTermKey(request, termCode, termList); final CacheKey scopedKey = getScopedKey(coursesByTermKey); final Element element = this.coursesByTermCache.get(scopedKey); if (element == null) { return null; } return (CoursesByTerm)element.getObjectValue(); }
element = super.get(key); } else { Sync lock = getLockForKey(key);