/** * Lazily evaluates the value of this metadata item. * * @throws MetadataEvaluationException if computing the metadata value * fails. */ private synchronized void eval() throws MetadataEvaluationException { if (cacheStrategy == CacheStrategy.NEVER_CACHE || internalValue.get() == null) { try { Object value = lazyValue.call(); if (value == null) { value = ACTUALLY_NULL; } internalValue = new SoftReference<Object>(value); } catch (Exception e) { throw new MetadataEvaluationException(e); } } }
/** * Lazily evaluates the value of this metadata item. * * @throws MetadataEvaluationException if computing the metadata value * fails. */ private synchronized void eval() throws MetadataEvaluationException { if (cacheStrategy == CacheStrategy.NEVER_CACHE || internalValue.get() == null) { try { Object value = lazyValue.call(); if (value == null) { value = ACTUALLY_NULL; } internalValue = new SoftReference<Object>(value); } catch (Exception e) { throw new MetadataEvaluationException(e); } } }