public T get()

in archaius2-core/src/main/java/com/netflix/archaius/property/DefaultPropertyContainer.java [199:219]


        public T get() {
            int cacheVersion = cache.getStamp();
            int latestVersion  = masterVersion.get();
            
            if (cacheVersion != latestVersion) {
                T currentValue = cache.getReference();
                T newValue = null;
                try {
                    newValue = resolveCurrent();
                } catch (Exception e) {
                    LOG.warn("Unable to get current version of property '{}'", key, e);
                }
                
                if (cache.compareAndSet(currentValue, newValue, cacheVersion, latestVersion)) {
                    // Slight race condition here but not important enough to warrent locking
                    lastUpdateTimeInMillis = System.currentTimeMillis();
                    return firstNonNull(newValue, defaultValue);
                }
            }
            return firstNonNull(cache.getReference(), defaultValue);
        }