use of org.jboss.weld.environment.se.contexts.ThreadContext in project core by weld.
the class WeldSEBeanRegistrant method registerWeldSEContexts.
public void registerWeldSEContexts(@Observes AfterBeanDiscovery event, BeanManager manager) {
if (ignoreEvent(event)) {
return;
}
final String contextId = BeanManagerProxy.unwrap(manager).getContextId();
this.threadContext = new ThreadContext(contextId);
event.addContext(threadContext);
// Register WeldContainer as a singleton
event.addBean().addType(WeldContainer.class).addQualifier(Default.Literal.INSTANCE).scope(Singleton.class).produceWith((i) -> WeldContainer.instance(contextId));
}
Aggregations