public LockedBean lock(final BeanIdentifier id) { LockStore lockStore = getLockStore(); if(lockStore == null) { //if the lockstore is null then no locking is necessary, as the underlying //context is single threaded return null; } return lockStore.lock(id); }
/** * Gets an enumeration of the attribute names present in the underlying * storage * * @return The attribute names */ protected Collection<String> getPrefixedAttributeNames() { return getNamingScheme().filterIds(getAttributeNames()); }
/** * Constructor */ protected AbstractSharedContext(String contextId) { super(contextId, true); this.beanStore = new ConcurrentHashMapBeanStore(); }
@Override public <T> ContextualInstance<T> get(BeanIdentifier id) { ContextualInstance<T> instance = super.get(id); if (instance == null && isAttached()) { String prefixedId = getNamingScheme().prefix(id); instance = cast(getAttribute(prefixedId)); } return instance; }
@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; }
@Override public <T> ContextualInstance<T> get(BeanIdentifier id) { ContextualInstance<T> instance = super.get(id); if (instance == null && isAttached()) { String prefixedId = getNamingScheme().prefix(id); instance = cast(getAttribute(prefixedId)); } return instance; }
@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; }
/** * 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 LockedBean lock(final BeanIdentifier id) { LockStore lockStore = getLockStore(); if(lockStore == null) { //if the lockstore is null then no locking is necessary, as the underlying //context is single threaded return null; } return lockStore.lock(id); }
@Override public <T> ContextualInstance<T> get(BeanIdentifier id) { ContextualInstance<T> instance = super.get(id); if (instance == null && isAttached()) { String prefixedId = getNamingScheme().prefix(id); instance = cast(getAttribute(prefixedId)); } return instance; }
@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; }
/** * 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 LockedBean lock(final BeanIdentifier id) { LockStore lockStore = getLockStore(); if(lockStore == null) { //if the lockstore is null then no locking is necessary, as the underlying //context is single threaded return null; } return lockStore.lock(id); }
@Override public <T> ContextualInstance<T> get(BeanIdentifier id) { ContextualInstance<T> instance = super.get(id); if (instance == null && isAttached()) { String prefixedId = getNamingScheme().prefix(id); instance = cast(getAttribute(prefixedId)); } return instance; }
@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; }
/** * 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 LockedBean lock(final BeanIdentifier id) { LockStore lockStore = getLockStore(); if(lockStore == null) { //if the lockstore is null then no locking is necessary, as the underlying //context is single threaded return null; } return lockStore.lock(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; }
/** * 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 LockedBean lock(final BeanIdentifier id) { LockStore lockStore = getLockStore(); if(lockStore == null) { //if the lockstore is null then no locking is necessary, as the underlying //context is single threaded return null; } return lockStore.lock(id); }