javax.enterprise.inject.spi

Interface AfterBeanDiscovery


  • public interface AfterBeanDiscovery

    The event type of the second event fired by the container when it has fully completed the bean discovery process, validated that there are no definition errors relating to the discovered beans, and registered Bean and ObserverMethod objects for the discovered beans, but before detecting deployment problems.

    A portable extension may take advantage of this event to register beans, interceptors, decorators, observer methods and custom context objects with the container.

         void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager) { ... }
     

    If any observer method of the AfterBeanDiscovery event throws an exception, the exception is treated as a definition error by the container.

    Author:
    David Allen
    • Method Detail

      • addDefinitionError

        void addDefinitionError(Throwable t)
        Registers a definition error with the container, causing the container to abort deployment after all observers have been notified.
        Parameters:
        t - The definition error as a Throwable
      • addBean

        void addBean(Bean<?> bean)
        Fires an event of type ProcessBean containing the given Bean and then registers the Bean with the container, thereby making it available for injection into other beans. The given Bean may implement Interceptor or Decorator.
        Parameters:
        bean - The bean to add to the deployment
      • addObserverMethod

        void addObserverMethod(ObserverMethod<?> observerMethod)
        Fires an event of type ProcessObserverMethod containing the given ObserverMethod and then registers the ObserverMethod with the container, thereby making it available for event notifications.
        Parameters:
        observerMethod - The custom observer method to add to the deployment
      • addContext

        void addContext(Context context)
        Registers a custom Context object with the container.
        Parameters:
        context - The custom context to add to the deployment
      • getAnnotatedType

        <T> AnnotatedType<T> getAnnotatedType(Class<T> type,
                                              String id)
        Obtain the AnnotatedType that may be used to read the annotations of the given class or interface as defined during container initialization.
        Type Parameters:
        T - the class or interface
        Parameters:
        type - the Class object
        id - the type identifier. If null, the fully qualifier class name of type is used
        Returns:
        the AnnotatedType
        Since:
        1.1
      • getAnnotatedTypes

        <T> Iterable<AnnotatedType<T>> getAnnotatedTypes(Class<T> type)
        Obtain the AnnotatedTypes that may be used to read the annotations of the given class or interface as defined during container initialization.
        Type Parameters:
        T - the class or interface
        Parameters:
        type - the Class object
        Returns:
        the AnnotatedTypes
        Since:
        1.1

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

21/08/2025 22:44:23 Cette version de la page est en cache (à la date du 21/08/2025 22:44:23) afin d'accélérer le traitement.
Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.

Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/enterprise/inject/spi/AfterBeanDiscovery.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, AfterBeanDiscovery (Java(TM) EE 7 Specification APIs)

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.