Package javax. enterprise. inject. spi

The portable extension integration SPI.

See: Description

Package javax.enterprise.inject.spi Description

The portable extension integration SPI.

A portable extension may integrate with the container by:

  • Providing its own beans, interceptors and decorators to the container
  • Injecting dependencies into its own objects using the dependency injection service
  • Providing a context implementation for a custom scope
  • Augmenting or overriding the annotation-based metadata with metadata from some other source

The BeanManager object

Portable extensions sometimes interact directly with the container via programmatic API call. The interface BeanManager provides operations for obtaining contextual references for beans, along with many other operations of use to portable extensions.

Container lifecycle events

During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the container initialization process. Observer methods of these events must belong to extensions declared in META-INF/services.

Lifecycle events include BeforeBeanDiscovery, AfterBeanDiscovery, AfterDeploymentValidation and BeforeShutdown.

Interfaces representing enabled beans

The interfaces Bean, Decorator, Interceptor and ObserverMethod define everything the container needs to manage instances of a bean, interceptor, decorator or observer method.

An instance of Bean exists for every enabled bean. A portable extension may add support for new kinds of beans by implementing Bean, observing the event AfterBeanDiscovery event registering beans with the container. An instance of ObserverMethod exists for every observer method of every enabled bean. A portable extension may add observers by implementing ObserverMethod and registering an instance with the container.

A portable extension may be notified of the existence of an enabled bean by observing the container lifecycle event type ProcessBean or one of its subtypes, or of the existence of an observer method of an enabled bean by observing the event type ProcessObserverMethod.

Alternate metadata sources

A portable extension may provide an alternative metadata source, such as configuration by XML.

Annotated and its subtypes allow a portable extension to specify metadata that overrides the annotations that exist on a bean class. The portable extension is responsible for implementing the interfaces, thereby exposing the metadata to the container. The container must use the operations of Annotated and its subinterfaces to discover program element types and annotations, instead of directly calling the Java Reflection API.

A portable extension provides its metadata to the container by observing the event ProcessAnnotatedType and wrapping the AnnotatedType.

Producer and InjectionTarget

The interfaces Producer and InjectionTarget abstract the basic lifecycle of (contextual or non-contextual) container managed objects, including instantiation and destruction, dependency injection and lifecycle callbacks.

An instance of InjectionTarget may be obtained from the BeanManager, allowing a portable extension to request these container services for objects under the control of the portable extension.

Furthermore, a portable extension may replace the implementation of InjectionTarget or Producer used by the container with its own implementation by observing the events ProcessInjectionTarget or ProcessProducer.

See Also:
javax.enterprise.inject, javax.enterprise.context.spi

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/package-summary.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

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com, javax.enterprise.inject.spi (Java(TM) EE 7 Specification APIs)

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.