public abstract class CDI<T> extends Object implements Instance<T>, AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected static CDIProvider |
configuredProvider |
protected static Set<CDIProvider> |
discoveredProviders |
| Constructor and Description |
|---|
CDI() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shuts down this CDI instance when it is no longer in scope.
|
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 context
|
static CDIProvider |
getCDIProvider() |
static void |
setCDIProvider(CDIProvider provider)
Set the
CDIProvider to use. |
abstract void |
shutdown()
Shuts down this CDI instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, isAmbiguous, isUnsatisfied, select, select, selectforEach, iterator, spliteratorprotected static volatile Set<CDIProvider> discoveredProviders
protected static volatile CDIProvider configuredProvider
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.
IllegalStateException - if no CDI provider is availablepublic 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.
provider - the provider to useIllegalStateException - if the CDIProvider is already setpublic abstract void shutdown()
Shuts down this CDI instance.
IllegalStateException - if called within an application server or if the container is not already startedpublic void close()
Shuts down this CDI instance when it is no longer in scope. Implemented from AutoCloseable,
close in interface AutoCloseablepublic abstract BeanManager getBeanManager()
public static CDIProvider getCDIProvider()
Copyright © 2008-2016 JBoss by Red Hat, Inc.. All Rights Reserved.