-
- All Superinterfaces:
java.lang.AutoCloseable,Instance<java.lang.Object>,java.lang.Iterable<java.lang.Object>,jakarta.inject.Provider<java.lang.Object>
public interface SeContainer extends Instance<java.lang.Object>, java.lang.AutoCloseable
Provides access to the current container in Java SE.SeContainer implements
Instanceand therefore might be used to perform programmatic lookup. If no qualifier is passed toInstance.select(java.lang.annotation.Annotation...)method, the@Defaultqualifier is assumed.CDI Lite implementations are not required to provide support for CDI in Java SE.
- Since:
- 2.0
- Author:
- Antoine Sabot-Durand, John D. Ament, Graeme Rocher
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jakarta.enterprise.inject.Instance
Instance.Handle<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Shuts down this SeContainer instance when it is no longer in scope.default BeanContainergetBeanContainer()Get the CDIBeanContainerfor this container.BeanManagergetBeanManager()Get the CDI BeanManager for this containerbooleanisRunning()Check if the container is running or was shut down-
Methods inherited from interface jakarta.enterprise.inject.Instance
destroy, getHandle, handles, handlesStream, isAmbiguous, isResolvable, isUnsatisfied, select, select, select, stream
-
-
-
-
Method Detail
-
close
void close()
Shuts down this SeContainer instance when it is no longer in scope. Implemented from
AutoCloseable,- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.IllegalStateException- if the container is already shutdown
-
isRunning
boolean isRunning()
Check if the container is running or was shut down- Returns:
- true if called before container shutdown
-
getBeanManager
BeanManager getBeanManager()
Get the CDI BeanManager for this container- Returns:
- the BeanManager
- Throws:
java.lang.IllegalStateException- if called when the container is already shutdown
-
getBeanContainer
default BeanContainer getBeanContainer()
Get the CDIBeanContainerfor this container. Default implementation just forwards the call togetBeanManager().- Returns:
- the
BeanContainer - Since:
- 4.0
-
-