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

[jsr344-experts] 1087-ViewScoped: PROPOSAL

From: Edward Burns <edward.burns_at_oracle.com>
Date: Thu, 2 Aug 2012 12:48:41 -0700

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/