Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 34. Performance Tuning


This chapter contains tips for getting the best performance from your Seam application.

34.1. Bypassing Interceptors

For repetitive value bindings such as those found in JavaServer Faces (JSF) dataTables, or in iterative controls such as ui:repeat, the full interceptor stack is invoked upon each invocation of the referenced Seam component. This can substantially decrease performance, particularly if the component is accessed many times. You can improve performance by disabling the interceptor stack for the invoked Seam component —annotate the component class with @BypassInterceptors.

Warning

Before you disable the interceptors, note that any component marked with @BypassInterceptors cannot use features such as bijection, annotated security restrictions, or synchronization. However, you can usually compensate for the loss of these features —for example, instead of injecting a component with @In, you can use Component.getInstance() instead.
The following code listing demonstrates a Seam component with its interceptors disabled:
@Name("foo")
@Scope(EVENT)
@BypassInterceptors
public class Foo {
  public String getRowActions() {
    // Role-based security check performed inline instead of using 
    // @Restrict or other security annotation
    Identity.instance().checkRole("user");
     
    // Inline code to lookup component instead of using @In
    Bar bar = (Bar) Component.getInstance("bar");
   
    String actions;   
    // some code here that does something     
    return actions;
  }
}
Copy to Clipboard Toggle word wrap
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat