Skip to content

Commit

Permalink
helpful note
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin King committed Nov 15, 2009
1 parent 987a441 commit 27fefcf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions reference/en-US/producermethods.xml
Expand Up @@ -92,6 +92,16 @@ public class Preferences implements Serializable {
same producer method. Thus, there could be multiple instances of the <literal>PaymentStrategy</literal>
object for each user session.
</para>

<note>
<para>
The producer method does <emphasis>not</emphasis> inherit the scope of the bean that declares the
method. There are two different beans here: the producer method, and the bean which declares it. The
scope of the producer method determines how often the method will be called, and the lifecycle of the
objects returned by the method. The scope of the bean that declares the producer method determines the
lifecycle of the object upon which the producer method is invoked.
</para>
</note>

<para>
To change this behavior, we can add a <literal>@SessionScoped</literal> annotation to the method.
Expand Down

0 comments on commit 27fefcf

Please sign in to comment.