Package io.quarkus.arc.runtime
Class BeanContainerImpl
- java.lang.Object
-
- io.quarkus.arc.runtime.BeanContainerImpl
-
- All Implemented Interfaces:
BeanContainer
public class BeanContainerImpl extends Object implements BeanContainer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
BeanContainerImpl.DefaultInstanceFactory<T>
-
Nested classes/interfaces inherited from interface io.quarkus.arc.runtime.BeanContainer
BeanContainer.Factory<T>, BeanContainer.Instance<T>
-
-
Constructor Summary
Constructors Constructor Description BeanContainerImpl(ArcContainer container)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> BeanContainer.Factory<T>
beanInstanceFactory(Class<T> type, Annotation... qualifiers)
Returns an instance factory for given bean type and qualifiers.<T> BeanContainer.Factory<T>
instanceFactory(Class<T> type, Annotation... qualifiers)
This method is deprecated and will be removed in future versions.ManagedContext
requestContext()
ManagedContext requestContext = beanContainer.requestContext(); if (requestContext.isActive()) { // Perform action } else { try { requestContext.activate(); // Perform action } finally { requestContext.terminate(); } }-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.arc.runtime.BeanContainer
beanInstance, instance
-
-
-
-
Constructor Detail
-
BeanContainerImpl
public BeanContainerImpl(ArcContainer container)
-
-
Method Detail
-
beanInstanceFactory
public <T> BeanContainer.Factory<T> beanInstanceFactory(Class<T> type, Annotation... qualifiers)
Description copied from interface:BeanContainer
Returns an instance factory for given bean type and qualifiers. This method follows standard CDI rules meaning that if there are two or more beans, an ambiguous dependency exception is thrown. Note that the factory itself is still allowed to returnnull
if there is no matching bean which allows for fallback implementations.- Specified by:
beanInstanceFactory
in interfaceBeanContainer
- Returns:
- a bean instance factory, never
null
-
instanceFactory
public <T> BeanContainer.Factory<T> instanceFactory(Class<T> type, Annotation... qualifiers)
Description copied from interface:BeanContainer
This method is deprecated and will be removed in future versions. UseBeanContainer.beanInstanceFactory(Class, Annotation...)
instead. As opposed toBeanContainer.beanInstanceFactory(Class, Annotation...)
, this method does NOT follow CDI resolution rules and in case of ambiguous resolution performs a choice based on the class type parameter.- Specified by:
instanceFactory
in interfaceBeanContainer
- Returns:
- a bean instance factory, never
null
-
requestContext
public ManagedContext requestContext()
Description copied from interface:BeanContainer
ManagedContext requestContext = beanContainer.requestContext(); if (requestContext.isActive()) { // Perform action } else { try { requestContext.activate(); // Perform action } finally { requestContext.terminate(); } }
- Specified by:
requestContext
in interfaceBeanContainer
- Returns:
- the context for
RequestScoped
-
-