/** * 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); } } }
@Override public <T> ContextualInstance<T> get(BeanIdentifier id) { ContextualInstance<T> instance = beanStore.get(id); if(instance == null && isAttached() && isAttributeLazyFetchingEnabled()) { instance = cast(getAttribute(namingScheme.prefix(id))); if(instance != null) { beanStore.put(id, instance); } } ContextLogger.LOG.contextualInstanceFound(id, instance, this); return instance; }