Package javax.enterprise.inject.spi
Class CDI<T>
- java.lang.Object
-
- javax.enterprise.inject.spi.CDI<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected static CDIProvider
configuredProvider
protected static java.util.Set<CDIProvider>
discoveredProviders
private static java.lang.Object
lock
private static java.util.regex.Pattern
nonCommentPattern
-
Constructor Summary
Constructors Constructor Description CDI()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CDI<java.lang.Object>
current()
Get the CDI instance that provides access to the current container.private static void
findAllProviders()
abstract BeanManager
getBeanManager()
Get the CDI BeanManager for the current contextprivate static java.util.Set<java.lang.String>
providerNamesFromReader(java.io.BufferedReader reader)
static 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
-
-
-
-
Field Detail
-
discoveredProviders
protected static volatile java.util.Set<CDIProvider> discoveredProviders
-
configuredProvider
protected static volatile CDIProvider configuredProvider
-
lock
private static final java.lang.Object lock
-
nonCommentPattern
private static final java.util.regex.Pattern nonCommentPattern
-
-
Method Detail
-
current
public static CDI<java.lang.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:
java.lang.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:
java.lang.IllegalStateException
- if theCDIProvider
is already set
-
findAllProviders
private static void findAllProviders()
-
providerNamesFromReader
private static java.util.Set<java.lang.String> providerNamesFromReader(java.io.BufferedReader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
getBeanManager
public abstract BeanManager getBeanManager()
Get the CDI BeanManager for the current context
-
-