Package dyntabs.scope

Annotation Interface TabScoped


@NormalScope(passivating=false) @Inherited @Documented @Target({TYPE,METHOD,FIELD}) @Retention(RUNTIME) public @interface TabScoped
CDI scope annotation for beans that live in the context of a dynamic tab.

Each DynTab has its own isolated scope - when two tabs are opened with the same includePage, each tab gets its own instance of the @TabScoped bean.

Lifecycle:

  • Bean is created when first accessed within a tab
  • Bean lives as long as the tab is open
  • Bean is destroyed when the tab is closed

Usage example:

 
 @Named
 @TabScoped
 public class MyTabBean implements DyntabBeanInterface {
     // ...
 }
 
 

IMPORTANT: A bean annotated with @TabScoped MUST implement DyntabBeanInterface and must be associated with a DynTab via the cdiBean property.

Author:
DynTabs
See Also: