- java.lang.Object
-
- javax.enterprise.inject.spi.CDI<T>
-
-
Field Summary
Fields Modifier and Type Field and Description protected static CDIProvider
configuredProvider
protected static Set<CDIProvider>
discoveredProviders
-
Constructor Summary
Constructors Constructor and Description CDI()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description static CDI<Object>
current()
Get the CDI instance that provides access to the current container.abstract BeanManager
getBeanManager()
Get the CDI BeanManager for the current contextstatic void
setCDIProvider(CDIProvider provider)
Set theCDIProvider
to use.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.enterprise.inject.Instance
destroy, isAmbiguous, isUnsatisfied, select, select, select
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface javax.inject.Provider
get
-
-
-
-
Field Detail
-
discoveredProviders
protected static volatile Set<CDIProvider> discoveredProviders
-
configuredProvider
protected static volatile CDIProvider configuredProvider
-
-
Method Detail
-
current
public static CDI<Object> current()
Get the CDI instance that provides access to the current container.
If there are no providers available, an
IllegalStateException
is thrown, otherwise the first provider which can access the container is used.- Throws:
IllegalStateException
- if no CDI provider is available
-
setCDIProvider
public static void setCDIProvider(CDIProvider provider)
Set the
CDIProvider
to use.If a
CDIProvider
is set using this method, any provider specified as a service provider will not be used.- Parameters:
provider
- the provider to use- Throws:
IllegalStateException
- if theCDIProvider
is already set
-
getBeanManager
public abstract BeanManager getBeanManager()
Get the CDI BeanManager for the current context- Returns:
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/enterprise/inject/spi/cdi.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.