-
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
andObserverMethod
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
addBean(Bean<?> bean)
Fires an event of typeProcessBean
containing the givenBean
and then registers theBean
with the container, thereby making it available for injection into other beans.void
addContext(Context context)
Registers a customContext
object with the container.void
addDefinitionError(Throwable t)
Registers a definition error with the container, causing the container to abort deployment after all observers have been notified.void
addObserverMethod(ObserverMethod<?> observerMethod)
Fires an event of typeProcessObserverMethod
containing the givenObserverMethod
and then registers theObserverMethod
with the container, thereby making it available for event notifications.<T> AnnotatedType<T>
getAnnotatedType(Class<T> type, String id)
Obtain theAnnotatedType
that may be used to read the annotations of the given class or interface as defined during container initialization.<T> Iterable<AnnotatedType<T>>
getAnnotatedTypes(Class<T> type)
Obtain theAnnotatedType
s that may be used to read the annotations of the given class or interface as defined during container initialization.
-
-
-
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 aThrowable
-
addBean
void addBean(Bean<?> bean)
Fires an event of typeProcessBean
containing the givenBean
and then registers theBean
with the container, thereby making it available for injection into other beans. The givenBean
may implementInterceptor
orDecorator
.- Parameters:
bean
- The bean to add to the deployment
-
addObserverMethod
void addObserverMethod(ObserverMethod<?> observerMethod)
Fires an event of typeProcessObserverMethod
containing the givenObserverMethod
and then registers theObserverMethod
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 customContext
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 theAnnotatedType
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
- theClass
objectid
- 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 theAnnotatedType
s 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
- theClass
object- Returns:
- the
AnnotatedType
s - Since:
- 1.1
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/enterprise/inject/spi/afterbeandiscovery.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.