public Iterator<BeanIdentifier> iterator() { Iterator<BeanIdentifier> iterator; if (isAttributeLazyFetchingEnabled()) { // Merge the bean identifiers from the local bean store and the backing store Set<BeanIdentifier> identifiers = new HashSet<>(); for (BeanIdentifier id : beanStore) { identifiers.add(id); } for (String prefixedId : getPrefixedAttributeNames()) { identifiers.add(getNamingScheme().deprefix(prefixedId)); } iterator = identifiers.iterator(); } else { iterator = beanStore.iterator(); } return iterator; }
/** * Fetch all relevant attributes from the backing store and copy instances which are not present in the local bean store. */ public void fetchUninitializedAttributes() { for (String prefixedId : getPrefixedAttributeNames()) { BeanIdentifier id = getNamingScheme().deprefix(prefixedId); if (!beanStore.contains(id)) { ContextualInstance<?> instance = (ContextualInstance<?>) getAttribute(prefixedId); beanStore.put(id, instance); ContextLogger.LOG.addingDetachedContextualUnderId(instance, id); } } }