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

org.jboss.weld.context.unbound.RequestContextImpl Maven / Gradle / Ivy

There is a newer version: 3.0.0.Alpha1
Show newest version
package org.jboss.weld.context.unbound;

import org.jboss.weld.context.AbstractUnboundContext;
import org.jboss.weld.context.RequestContext;
import org.jboss.weld.context.beanstore.HashMapBeanStore;

import javax.enterprise.context.RequestScoped;
import java.lang.annotation.Annotation;

public class RequestContextImpl extends AbstractUnboundContext implements RequestContext {

    public RequestContextImpl(String contextId) {
        super(contextId, false);
    }

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

    public void activate() {
        // Attach bean store (this context is unbound, so this can simply be thread-scoped
        setBeanStore(new HashMapBeanStore());
        super.activate();
    }

    @Override
    public void deactivate() {
        super.deactivate();
        // Detach the bean store
        setBeanStore(null);
        cleanup();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy