SeamFramework.orgCommunity Documentation
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.
It is very important to be aware of the implications of disabling interceptors for a Seam component.
Features such as bijection, annotated security restrictions, synchronization and others are
unavailable for a component marked with @BypassInterceptors
. While in most cases
it is possible to compensate for the loss of these features (e.g. instead of injecting a component
using @In
, you can use Component.getInstance()
instead) it is
important to be aware of the consequences.
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; } }