Package javax.enterprise.inject.spi
Class CDI<T>
java.lang.Object
javax.enterprise.inject.spi.CDI<T>
Provides access to the current container.
- Since:
- 1.1
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncurrent()
Get the CDI instance that provides access to the current container.abstract BeanManager
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
-
Field Details
-
discoveredProviders
-
configuredProvider
-
-
Constructor Details
-
CDI
public CDI()
-
-
Method Details
-
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
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
Get the CDI BeanManager for the current context- Returns:
-