Package io.quarkus.arc.impl
Class ArcContainerImpl
java.lang.Object
io.quarkus.arc.impl.ArcContainerImpl
- All Implemented Interfaces:
ArcContainer
-
Constructor Summary
ConstructorsConstructorDescriptionArcContainerImpl(CurrentContextFactory currentContextFactory, boolean strictMode) -
Method Summary
Modifier and TypeMethodDescription<T> InjectableBean<T><T> Supplier<InstanceHandle<T>>beanInstanceSupplier(Class<T> type, Annotation... qualifiers) Returns a supplier that can be used to create new instances, or null if no matching bean can be found.jakarta.enterprise.inject.spi.BeanManagerNOTE: Not all methods are supported!getActiveContext(Class<? extends Annotation> scopeType) UnlikeBeanContainer.getContext(Class)this method does not throwContextNotActiveExceptionif there is no active context for the given scope.List<InjectableBean<?>>getBeans()getContexts(Class<? extends Annotation> scopeType) Set<Class<? extends Annotation>>voidinit()static ArcContainerImplinstance()<T> InstanceHandle<T>instance(InjectableBean<T> bean) <T> InstanceHandle<T>instance(jakarta.enterprise.util.TypeLiteral<T> type, Annotation... qualifiers) Never returns null.<T> InstanceHandle<T>instance(Class<T> type, Annotation... qualifiers) Never returns null.<X> InstanceHandle<X>instance(Type type, Annotation... qualifiers) Never returns null.<T> InstanceHandle<T>Never returns null.booleanReturns true if Arc container is running.<T> List<InstanceHandle<T>>listAll(jakarta.enterprise.util.TypeLiteral<T> type, Annotation... qualifiers) List all beans matching the required type and qualifiers.<T> List<InstanceHandle<T>>listAll(Class<T> type, Annotation... qualifiers) List all beans matching the required type and qualifiers.<X> List<InstanceHandle<X>>listAll(Type type, Annotation... qualifiers) static voidmockObservers(String beanIdentifier, boolean mock) voidmockObserversFor(Class<?> beanClass, boolean mock) Note that ambiguous names are detected at build time.This method never throwsContextNotActiveException.<T> InjectableInstance<T>select(jakarta.enterprise.util.TypeLiteral<T> type, Annotation... qualifiers) Instances of dependent scoped beans obtained with the returned injectable instance must be explicitly destroyed, either via theInstance.destroy(Object)method invoked upon the same injectable instance or withInstanceHandle.destroy().<T> InjectableInstance<T>select(Class<T> type, Annotation... qualifiers) Instances of dependent scoped beans obtained with the returned injectable instance must be explicitly destroyed, either via theInstance.destroy(Object)method invoked upon the same injectable instance or withInstanceHandle.destroy().voidsetExecutor(ExecutorService executor) voidshutdown()booleanIndicates whether container runs in strict compatibility mode.toString()
-
Constructor Details
-
ArcContainerImpl
-
-
Method Details
-
init
public void init() -
getActiveContext
Description copied from interface:ArcContainerUnlikeBeanContainer.getContext(Class)this method does not throwContextNotActiveExceptionif there is no active context for the given scope.- Specified by:
getActiveContextin interfaceArcContainer- Returns:
- the active context or null
-
getContexts
- Specified by:
getContextsin interfaceArcContainer- Returns:
- the matching context objects, never null
-
getScopes
- Specified by:
getScopesin interfaceArcContainer- Returns:
- the set of all supported scopes
-
instance
Description copied from interface:ArcContainerNever returns null. However, the handle is empty if no bean matches/multiple beans match the specified type and qualifiers.- Specified by:
instancein interfaceArcContainer- Returns:
- a new instance handle
-
instance
public <T> InstanceHandle<T> instance(jakarta.enterprise.util.TypeLiteral<T> type, Annotation... qualifiers) Description copied from interface:ArcContainerNever returns null. However, the handle is empty if no bean matches/multiple beans match the specified type and qualifiers.- Specified by:
instancein interfaceArcContainer- Returns:
- a new instance handle
-
instance
Description copied from interface:ArcContainerNever returns null. However, the handle is empty if no bean matches/multiple beans match the specified type and qualifiers.- Specified by:
instancein interfaceArcContainer- Returns:
- a new instance handle
-
beanInstanceSupplier
public <T> Supplier<InstanceHandle<T>> beanInstanceSupplier(Class<T> type, Annotation... qualifiers) Description copied from interface:ArcContainerReturns a supplier that can be used to create new instances, or null if no matching bean can be found.- Specified by:
beanInstanceSupplierin interfaceArcContainer- Returns:
-
instance
- Specified by:
instancein interfaceArcContainer- Returns:
- a new bean instance handle
-
select
Description copied from interface:ArcContainerInstances of dependent scoped beans obtained with the returned injectable instance must be explicitly destroyed, either via theInstance.destroy(Object)method invoked upon the same injectable instance or withInstanceHandle.destroy(). If no qualifier is passed, the @Default qualifier is assumed.- Specified by:
selectin interfaceArcContainer- Returns:
- a new injectable instance that could be used for programmatic lookup
-
select
public <T> InjectableInstance<T> select(jakarta.enterprise.util.TypeLiteral<T> type, Annotation... qualifiers) Description copied from interface:ArcContainerInstances of dependent scoped beans obtained with the returned injectable instance must be explicitly destroyed, either via theInstance.destroy(Object)method invoked upon the same injectable instance or withInstanceHandle.destroy(). If no qualifier is passed, the @Default qualifier is assumed.- Specified by:
selectin interfaceArcContainer- Returns:
- a new injectable instance that could be used for programmatic lookup
-
listAll
Description copied from interface:ArcContainerList all beans matching the required type and qualifiers.Instances of dependent scoped beans should be explicitly destroyed with
InstanceHandle.destroy().The list is sorted by
InjectableBean.getPriority(). Higher priority goes first.- Specified by:
listAllin interfaceArcContainer- Returns:
- the list of handles for the disambiguated beans
- See Also:
-
listAll
public <T> List<InstanceHandle<T>> listAll(jakarta.enterprise.util.TypeLiteral<T> type, Annotation... qualifiers) Description copied from interface:ArcContainerList all beans matching the required type and qualifiers.Instances of dependent scoped beans should be explicitly destroyed with
InstanceHandle.destroy().The list of is sorted by
InjectableBean.getPriority(). Higher priority goes first.- Specified by:
listAllin interfaceArcContainer- Returns:
- the list of handles for the disambiguated beans
- See Also:
-
listAll
- Specified by:
listAllin interfaceArcContainer- Returns:
- the list of handles for the disambiguated beans
- See Also:
-
isRunning
public boolean isRunning()Description copied from interface:ArcContainerReturns true if Arc container is running. This can be used as a quick check to determine CDI availability in Quarkus.- Specified by:
isRunningin interfaceArcContainer- Returns:
- true if
ArcContaineris running, false otherwise
-
bean
- Specified by:
beanin interfaceArcContainer- Returns:
- an injectable bean or null
- See Also:
-
namedBean
Description copied from interface:ArcContainerNote that ambiguous names are detected at build time. Therefore, unlike {@link jakarta.enterprise.inject.spi.BeanManager.getBeans(String)} this method either returns a resolved bean ornullif no bean matches.- Specified by:
namedBeanin interfaceArcContainer- Returns:
- an injectable bean with the given name or null
- See Also:
-
instance
Description copied from interface:ArcContainerNever returns null. However, the handle is empty if no bean matches/multiple beans match the specified name.- Specified by:
instancein interfaceArcContainer- Returns:
- a new instance handle
- See Also:
-
requestContext
Description copied from interface:ArcContainerThis method never throwsContextNotActiveException.- Specified by:
requestContextin interfaceArcContainer- Returns:
- the built-in context for
RequestScoped
-
beanManager
public jakarta.enterprise.inject.spi.BeanManager beanManager()Description copied from interface:ArcContainerNOTE: Not all methods are supported!- Specified by:
beanManagerin interfaceArcContainer- Returns:
- the bean manager
-
getExecutorService
- Specified by:
getExecutorServicein interfaceArcContainer- Returns:
- the default executor service
-
setExecutor
-
getCurrentContextFactory
- Specified by:
getCurrentContextFactoryin interfaceArcContainer- Returns:
- the factory
- See Also:
-
strictCompatibility
public boolean strictCompatibility()Description copied from interface:ArcContainerIndicates whether container runs in strict compatibility mode. Default value is false.- Specified by:
strictCompatibilityin interfaceArcContainer- Returns:
- true is strict mode is enabled, false otherwise.
-
toString
-
shutdown
public void shutdown() -
getBeans
-
getRemovedBeans
-
getInterceptors
-
getDecorators
-
getObservers
-
mockObservers
-
mockObserversFor
-
instance
-