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

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

From: Ken Finnigan <kfinniga_at_redhat.com>
Date: Thu, 2 Aug 2012 16:00:28 -0400 (EDT)

+1 to that, makes sense to base it off CDI in preparation for ManagedBean deprecation.

Ken

----- Original Message -----
From: "Edward Burns" <edward.burns_at_oracle.com>
To: jsr344-experts_at_javaserverfaces-spec-public.java.net
Sent: Thursday, August 2, 2012 3:48:41 PM
Subject: [jsr344-experts] 1087-ViewScoped: PROPOSAL

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/