jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] Re: 1087-ViewScoped: PROPOSAL

From: Frank Caputo <frank_at_frankcaputo.de>
Date: Fri, 3 Aug 2012 21:24:25 +0200

Hi Ed,

how does the new CDI scope fit into the javax.faces.flow package? It is not a specific feature of flows.

Ciao Frank

Am 02.08.2012 um 21:48 schrieb Edward Burns:

> Hello Experts,
>
> JSF 2.0 added the annotation javax.faces.bean.ViewScoped [1].
> Currently, it's specification is tightly bound to the pre-CDI Managed
> Bean specification, which will eventually be deprecated.
>
> When this annotation, along with ManagedBean is found on a class, the
> runtime must act as if a <managed-bean-scope>view<managed-bean-scope>
> element was declared for the corresponding managed bean.
>
> 730-FacesFlows introduces a @FlowScoped [2].
>
> FlowScoped is a CDI scope that causes the runtime to consider classes
> with this annotation to be in the scope of the specified Flow. The
> implementation must provide an implementation of
> javax.enterprise.inject.spi.Extension that implements the semantics
> such that beans with this annotation are created when the user enters
> into the specified Flow, and de-allocated when the user exits the
> specified Flow.
>
> PROPOSAL
>
> Create a new annotation javax.faces.flow.ViewScoped with this
> specification.
>
> ViewScoped is a CDI scope that causes the runtime to consider classes
> with this annotation to be in scope as long as the user stays on the
> same view. When the user navigates to a different view, @ViewScoped
> beans must be made available for garbage collection.
>
> Ed
>
> [1] https://maven.java.net/service/local/repositories/snapshots/archive/javax/faces/javax.faces-api/2.2-SNAPSHOT/javax.faces-api-2.2-20120802.084909-40-javadoc.jar/!/managed-bean-javadocs/javax/faces/bean/ViewScoped.html
>
> [2] https://maven.java.net/service/local/repositories/snapshots/archive/javax/faces/javax.faces-api/2.2-SNAPSHOT/javax.faces-api-2.2-20120802.084909-40-javadoc.jar/!/javadocs/javax/faces/flow/FlowScoped.html
>
> --
> | edward.burns_at_oracle.com | office: +1 407 458 0017
> | homepage: | http://ridingthecrest.com/
>