Specifies that a bean belongs to the dependent pseudo-scope.
Beans declared with scope @Dependent behave differently to beans with other built-in scope types. When a bean is declared to have scope @Dependent:
Every invocation of the javax.enterprise.context.spi.Context#get(Contextual, CreationalContext) operation of the
context object for the @Dependent scope returns a new instance of the given bean.
Every invocation of the javax.enterprise.context.spi.Context#get(Contextual) operation of the context object for the
@Dependent scope returns a null value.
The @Dependent scope is always active.
Many instances of beans with scope @Dependent belong to some other bean or Java EE component class instance and are called dependent objects.
javax.enterprise.inject.Instance is a dependent object of the instance of javax.enterprise.inject.Instance.When the container destroys an instance of a bean or of any Java EE component class supporting injection, the container destroys all its dependent objects, after the @PreDestroy callback completes and after the servlet destroy() method is called.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Dependent.Literal
Supports inline instantiation of the |
Dependent annotation.
| Modifier and Type | Field and Description |
|---|---|
| public static final Dependent. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| INSTANCE | back to summary |
|---|---|
| public static final Dependent. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides javax. | |
| Literal | back to summary |
|---|---|
| public Literal() | |