Package javax.decorator

Annotations relating to decorators.

See: Description

Package javax.decorator Description

Annotations relating to decorators.

A decorator implements one or more bean types and intercepts business method invocations of beans which implement those bean types. These bean types are called decorated types.

A decorator is a managed bean annotated @Decorator.

Decorators are superficially similar to interceptors, but because they directly implement operations with business semantics, they are able to implement business logic and, conversely, unable to implement the cross-cutting concerns for which interceptors are optimized. Decorators are called after interceptors.

Decorated types

The set of decorated types of a decorator includes all bean types of the managed bean that are Java interfaces, except for Serializable. The decorator bean class and its superclasses are not decorated types of the decorator. The decorator class may be abstract.

A decorator intercepts every method:

  • declared by a decorated type of the decorator
  • that is implemented by the bean class of the decorator.

A decorator may be an abstract class, and is not required to implement every method of every decorated type.

Delegate injection points

All decorators have a delegate injection point. A delegate injection point is an injection point of the bean class annotated @Delegate.

The type of the delegate injection point must implement or extend every decorated type. A decorator is not required to implement the type of the delegate injection point.

Enabled decorators

By default, a bean archive has no enabled decorators. A decorator must be explicitly enabled by listing its bean class under the <decorators> element of the beans.xml file of the bean archive. The order of the decorator declarations determines the decorator ordering. Decorators which occur earlier in the list are called first.

A decorator is bound to a bean if:

  • The bean is eligible for injection to the delegate injection point of the decorator.
  • The decorator is enabled in the bean archive of the bean.

If a managed bean class is declared final, it may not have decorators. If a managed bean has a non-static, non-private, final method, it may not have any decorator which implements that method.

A decorator instance is a dependent object of the object it decorates.

See Also:
javax.enterprise.inject, Decorator, Delegate

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 15:08:43 Cette version de la page est en cache (à la date du 21/08/2025 15:08:43) 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/decorator/package-summary.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, javax.decorator (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.