Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * JBoss, Home of Professional Open Source
  * Copyright 2014, Red Hat, Inc., and individual contributors
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.jboss.weld.context.beanstore;
import static org.jboss.weld.util.reflection.Reflections.cast;
A MapBeanStore whose LockStore is associated with the key LOCK_STORE_KEY in the provided map and so may be shared across several stores used within a single "session". Moreover BeanStore.get(org.jboss.weld.serialization.spi.BeanIdentifier) not only searches the cached bean store in AttributeBeanStore but also the underlying map.

Martin Kouba
See also:
public class SessionMapBeanStore extends MapBeanStore {
    private static final String LOCK_STORE_KEY = "org.jboss.weld.context.beanstore.LockStore";
    public SessionMapBeanStore(NamingScheme namingSchemeMap<StringObjectdelegate) {
    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;
    public LockStore getLockStore() {
        LockStore lockStore = this.;
        if (lockStore == null) {
            lockStore = (LockStoregetAttribute();
            if (lockStore == null) {
                synchronized (SessionMapBeanStore.class) {
                    lockStore = (LockStoregetAttribute();
                    if (lockStore == null) {
                        lockStore = new LockStore();
            this. = lockStore;
        return lockStore;
New to GrepCode? Check out our FAQ X