-
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
-
-
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/inject/spi/afterbeandiscovery.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
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.