synchronized public Object get(Object key) { return delegate.get(key); }
synchronized public Object peek(Object key) { return delegate.get(key); }
public V get(K key) { return (V)policy.get(key); }
public ClassReader get(String classname) { return (ClassReader)policy.get(classname); }
public V remove(K key) { V old = (V)policy.get(key); policy.remove(key); return old; }
public V put(K key, V value) { V old = (V)policy.get(key); policy.insert(key, value); return old; }
public CtClass get(String classname, int viewId) { if (viewId != this.viewId) { synchronized(policy) { invalidate(); if (viewId > this.viewId) this.viewId = viewId; } } return (CtClass)policy.get(classname); }
/** An accessor method that synchronizes access on the domainCache to avoid a race condition that can occur when the cache entry expires in the presence of multi-threaded access. The allowRefresh flag should be true for authentication accesses and false for other accesses. Previously the other accesses included authorization and caller principal mapping. Now the only use of the @param principal - the caller identity whose cached credentials are to be accessed. @param allowRefresh - a flag indicating if the cache access should flush any expired entries. */ private DomainInfo getCacheInfo(Principal principal, boolean allowRefresh) { if( domainCache == null ) return null; DomainInfo cacheInfo = null; synchronized( domainCache ) { if( allowRefresh == true ) cacheInfo = (DomainInfo) domainCache.get(principal); else cacheInfo = (DomainInfo) domainCache.peek(principal); if( cacheInfo != null ) cacheInfo.acquire(); } return cacheInfo; }
/** An accessor method that synchronizes access on the domainCache to avoid a race condition that can occur when the cache entry expires in the presence of multi-threaded access. The allowRefresh flag should be true for authentication accesses and false for other accesses. Previously the other accesses included authorization and caller principal mapping. Now the only use of the @param principal - the caller identity whose cached credentials are to be accessed. @param allowRefresh - a flag indicating if the cache access should flush any expired entries. */ private DomainInfo getCacheInfo(Principal principal, boolean allowRefresh) { if (domainCache == null) return null; DomainInfo cacheInfo = null; synchronized (domainCache) { if (allowRefresh == true) cacheInfo = (DomainInfo) domainCache.get(principal); else cacheInfo = (DomainInfo) domainCache.peek(principal); if (cacheInfo != null) cacheInfo.acquire(); } return cacheInfo; }
ctx = (EnterpriseContext)cache.get(id); if (ctx == null)
ctx = (EnterpriseContext)getCache().get(id); if (ctx != null)
getCache().get(id);