All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.weld.context.bound.BoundSessionContextImpl Maven / Gradle / Ivy

There is a newer version: 6.0.0.Beta4
Show newest version
package org.jboss.weld.context.bound;

import org.jboss.weld.context.AbstractBoundContext;
import org.jboss.weld.context.beanstore.MapBeanStore;
import org.jboss.weld.context.beanstore.NamingScheme;
import org.jboss.weld.context.beanstore.SimpleNamingScheme;

import javax.enterprise.context.SessionScoped;
import java.lang.annotation.Annotation;
import java.util.Map;

public class BoundSessionContextImpl extends AbstractBoundContext> implements BoundSessionContext {

    private final NamingScheme namingScheme;

    public BoundSessionContextImpl() {
        super(false);
        this.namingScheme = new SimpleNamingScheme(BoundSessionContext.class.getName());
    }

    public Class getScope() {
        return SessionScoped.class;
    }

    public boolean associate(Map storage) {
        if (getBeanStore() == null) {
            setBeanStore(new MapBeanStore(namingScheme, storage));
            return true;
        } else {
            return false;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy