Este contenido no está disponible en el idioma seleccionado.

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
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat