Ejemplo n.º 1
0
 private CachedProps refresh(Key key, CachedProps cp)
 {
     List files = m_env.findAllFiles(Uri.fromStr("etc/" + key.m_pod + "/" + key.m_uri));
       if (cp != null && !cp.isStale(files)) return cp;
       if (key.m_uri.isPathAbs()) throw ArgErr.make("Env.props Uri must be relative: " + key.m_uri).val;
       cp = new CachedProps(key, files);
       m_cache[key] = cp;
       return cp;
 }
Ejemplo n.º 2
0
        public Map get(Pod pod, Uri uri, Duration maxAge)
        {
            Key         key = new Key(pod, uri);
            CachedProps cp  = (CachedProps)m_cache[key];

            if (cp == null || Duration.nowTicks() - cp.m_read > maxAge.m_ticks)
            {
                cp = refresh(key, cp);
            }
            return(cp.m_props);
        }
Ejemplo n.º 3
0
        private CachedProps refresh(Key key, CachedProps cp)
        {
            List files = m_env.findAllFiles(Uri.fromStr("etc/" + key.m_pod + "/" + key.m_uri));

            if (cp != null && !cp.isStale(files))
            {
                return(cp);
            }
            if (key.m_uri.isPathAbs())
            {
                throw ArgErr.make("Env.props Uri must be relative: " + key.m_uri).val;
            }
            cp           = new CachedProps(key, files);
            m_cache[key] = cp;
            return(cp);
        }