SeamFramework.orgCommunity Documentation

Chapter 37. Performance Tuning

37.1. Bypassing Interceptors

This chapter is an attempt to document in one place all the tips for getting the best performance from your Seam application.

For repetitive value bindings such as those found in a JSF dataTable or other iterative control (like ui:repeat), the full interceptor stack will be invoked for every invocation of the referenced Seam component. The effect of this can result in a substantial performance hit, especially if the component is accessed many times. A significant performance gain can be achieved by disabling the interceptor stack for the Seam component being invoked. To disable interceptors for the component, add the @BypassInterceptors annotation to the component class.

The following code listing demonstrates a Seam component with its interceptors disabled:


public class Foo
   public String getRowActions()
     // Role-based security check performed inline instead of using @Restrict or other security annotation
     // 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;