javax.enterprise.context

Annotation Type Dependent


  • @Target(value={METHOD,TYPE,FIELD})
     @Retention(value=RUNTIME)
     @Documented
     @Scope
     @Inherited
    public @interface Dependent

    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:

    • No injected instance of the bean is ever shared between multiple injection points.
    • Any instance of the bean injected into an object that is being created by the container is bound to the lifecycle of the newly created object.
    • When a Unified EL expression in a JSF or JSP page that refers to the bean by its EL name is evaluated, at most one instance of the bean is instantiated. This instance exists to service just a single evaluation of the EL expression. It is reused if the bean EL name appears multiple times in the EL expression, but is never reused when the EL expression is evaluated again, or when another EL expression is evaluated.
    • Any instance of the bean that receives a producer method, producer field, disposer method or observer method invocation exists to service that invocation only.
    • Any instance of the bean injected into method parameters of a disposer method or observer method exists to service the method invocation only.

    Every invocation of the 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 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.

    • Instances of decorators and interceptors are dependent objects of the bean instance they decorate.
    • An instance of a bean with scope @Dependent injected into a field, bean constructor or initializer method is a dependent object of the bean or Java EE component class instance into which it was injected.
    • An instance of a bean with scope @Dependent injected into a producer method is a dependent object of the producer method bean instance that is being produced.
    • An instance of a bean with scope @Dependent obtained by direct invocation of an Instance is a dependent object of the instance of 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.

    Author:
    Gavin King, Pete Muir

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/enterprise/context/Dependent.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com/en/java/, Annotation Type Dependent

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.