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

[jsr372-experts] Re: _at_FlowScoped not entirely consistent?

From: Edward Burns <edward.burns_at_oracle.com>
Date: Wed, 12 Aug 2015 15:34:59 -0700

>>>>> On Wed, 12 Aug 2015 00:26:33 +0200, arjan tijms <arjan.tijms_at_gmail.com> said:

AT> Hi,
AT> For the CDI alignment story I happened to be looking at @FlowScoped
AT> and I wonder why it has a mandatory value attribute where a flow id
AT> has to be put.

AT> I could see this being useful for the purpose of creating a bean as
AT> soon as the flow scope for the flow with that id is started (a kind of
AT> @Eager).

yes, that is how it's specified:

Spec> FlowScoped is a CDI scope that causes the runtime to consider
Spec> classes with this annotation to be in the scope of the specified
Spec> Flow. [...] beans with this annotation are created when
Spec> the user enters into the specified Flow, and de-allocated when the
Spec> user exits the specified Flow.

But I don't think it's 100% eager. I think they only get created when
something such as EL tries to access it.

Finally, the main reason the value is necessary is that how else can a
FlowScoped bean be declared to be in a scope?

Ed

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| 59 Business days til JavaOne 2015
| 74 Business days til DOAG 2015