Top Description Inners Methods
javax.enterprise.context

public @Interface Dependent

extends Annotation
Known Direct Implementers
javax.enterprise.context.Dependent.Literal
Annotations
@Target:METHOD, TYPE, FIELD
@Retention:RUNTIME
@Documented
@Scope
@Inherited
Static Imports
java.lang.annotation.ElementType.FIELD, .ElementType.METHOD, .ElementType.TYPE, .RetentionPolicy.RUNTIME

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.

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.

Authors
Gavin King, Pete Muir

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Dependent.Literal

Supports inline instantiation of the Dependent annotation.

Method Summary

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString
javax.enterprise.context back to summary

public final Class Dependent.Literal

extends AnnotationLiteral<Dependent>
implements Dependent
Class Inheritance
All Implemented Interfaces
javax.enterprise.context.Dependent, java.lang.annotation.Annotation

Supports inline instantiation of the Dependent annotation.
Author
Martin Kouba
Since
2.0

Field Summary

Modifier and TypeField and Description
public static final Dependent.Literal
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from javax.enterprise.util.AnnotationLiteral:
annotationTypeequalshashCodetoString

Field Detail

INSTANCEback to summary
public static final Dependent.Literal INSTANCE
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.enterprise.util.AnnotationLiteral.serialVersionUID.

Constructor Detail

Literalback to summary
public Literal()