public void clear() { Iterator<BeanIdentifier> it = iterator(); while (it.hasNext()) { BeanIdentifier id = it.next(); if (isAttached()) { String prefixedId = namingScheme.prefix(id); removeAttribute(prefixedId); } it.remove(); ContextLogger.LOG.contextualInstanceRemoved(id, this); } ContextLogger.LOG.contextCleared(this); }
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; }
/** * Gets an enumeration of the attribute names present in the underlying * storage * * @return The attribute names */ protected Collection<String> getPrefixedAttributeNames() { return getNamingScheme().filterIds(getAttributeNames()); }
public void clear() { Iterator<BeanIdentifier> it = iterator(); while (it.hasNext()) { BeanIdentifier id = it.next(); if (isAttached()) { String prefixedId = namingScheme.prefix(id); removeAttribute(prefixedId); } it.remove(); ContextLogger.LOG.contextualInstanceRemoved(id, this); } ContextLogger.LOG.contextCleared(this); }
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; }
/** * Gets an enumeration of the attribute names present in the underlying * storage * * @return The attribute names */ protected Collection<String> getPrefixedAttributeNames() { return getNamingScheme().filterIds(getAttributeNames()); }
public void clear() { Iterator<BeanIdentifier> it = iterator(); while (it.hasNext()) { BeanIdentifier id = it.next(); if (isAttached()) { String prefixedId = namingScheme.prefix(id); removeAttribute(prefixedId); } it.remove(); ContextLogger.LOG.contextualInstanceRemoved(id, this); } ContextLogger.LOG.contextCleared(this); }
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; }
/** * Gets an enumeration of the attribute names present in the underlying * storage * * @return The attribute names */ protected Collection<String> getPrefixedAttributeNames() { return getNamingScheme().filterIds(getAttributeNames()); }
public void clear() { Iterator<BeanIdentifier> it = iterator(); while (it.hasNext()) { BeanIdentifier id = it.next(); if (isAttached()) { String prefixedId = namingScheme.prefix(id); removeAttribute(prefixedId); } it.remove(); ContextLogger.LOG.contextualInstanceRemoved(id, this); } ContextLogger.LOG.contextCleared(this); }
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; }
/** * Gets an enumeration of the attribute names present in the underlying * storage * * @return The attribute names */ protected Collection<String> getPrefixedAttributeNames() { return getNamingScheme().filterIds(getAttributeNames()); }
public void clear() { Iterator<BeanIdentifier> it = iterator(); while (it.hasNext()) { BeanIdentifier id = it.next(); if (isAttached()) { String prefixedId = namingScheme.prefix(id); removeAttribute(prefixedId); } it.remove(); ContextLogger.LOG.contextualInstanceRemoved(id, this); } ContextLogger.LOG.contextCleared(this); }
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; }
/** * Gets an enumeration of the attribute names present in the underlying * storage * * @return The attribute names */ protected Collection<String> getPrefixedAttributeNames() { return getNamingScheme().filterIds(getAttributeNames()); }
@Override public <T> ContextualInstance<T> remove(BeanIdentifier id) { ContextualInstance<T> instance = beanStore.remove(id); if (instance != null) { if (isAttached()) { removeAttribute(namingScheme.prefix(id)); } ContextLogger.LOG.contextualInstanceRemoved(id, this); } return instance; }
/** * 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> remove(BeanIdentifier id) { ContextualInstance<T> instance = beanStore.remove(id); if (instance != null) { if (isAttached()) { removeAttribute(namingScheme.prefix(id)); } ContextLogger.LOG.contextualInstanceRemoved(id, this); } return instance; }
/** * 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> remove(BeanIdentifier id) { ContextualInstance<T> instance = beanStore.remove(id); if (instance != null) { if (isAttached()) { removeAttribute(namingScheme.prefix(id)); } ContextLogger.LOG.contextualInstanceRemoved(id, this); } return instance; }