Package com.vaadin.cdi.annotation
Annotation Type UIScoped
-
@Scope @Inherited @Target({ANNOTATION_TYPE,TYPE,FIELD,METHOD,CONSTRUCTOR}) @Retention(RUNTIME) public @interface UIScoped
The lifecycle of a UIScoped component is bound to a browser tab.Injection with this annotation will create a direct reference to the object rather than a proxy.
There are some limitations when not using proxies. Circular referencing (that is, injecting A to B and B to A) will not work. Injecting into a larger scope will bind the instance from the currently active smaller scope, and will ignore smaller scope change. For example after being injected into session scope it will point to the same
UIScopedbean instance ( even itsUIis closed ) regardless ofUIchange.The sister annotation to this is the
NormalUIScoped. Both annotations reference the same underlying scope, so it is possible to get both a proxy and a direct reference to the same object by using different annotations.