Hi!

Yup, it got already challenged and should not show up in the CDI-1.1 TCK. 


As for my statement below regarding 6.4.2: I now talked with a few fellow CDI 
EG members and they interpret it as _only_ mean the OuterBean case. So the 
OuterBean really gets destroyed immediately after createUser.

As for the any conatainer created @Dependent parameter please see
https://issues.jboss.org/browse/CDI-228

LieGrue,
strub


>________________________________
> From: Nikolai Dokovski <[email protected]>
>To: [email protected]; Mark Struberg <[email protected]> 
>Sent: Friday, May 18, 2012 1:23 PM
>Subject: Re: Passivation dependencies of producer method are not validated
> 
>
>Aha got it.
>But then the test should be challenged, I suppose.
>
>cheers
>
>
>On Fri, May 18, 2012 at 2:17 PM, Mark Struberg <[email protected]> wrote:
>
>
>>
>>Hi Nikolai!
>>
>>Congratulations, you went pretty deep already ;)
>>
>>please consider the following situation:
>>
>>@Dependent
>>public class OuterBean {
>>  private @Inject SomeNotSerializableBean s;
>>
>>  @Produces @SessionScoped
>>  public User createUser() {
>>    return getUserFromDatabase();
>>  }
>>}
>>
>>When somewhere in a code a
>>
>>private @Inject User u;
>>u.getName();
>>
>>gets executed, the container will create the Contextual Instance for the user 
>>(if there is none in the session already -> 'SessionSingleton').
>>For doing so the container will
>>
>>a.) create a OuterBean o
>>b.) invoke the o.createUser(); method and store the created User in the 
>>SessionContext.
>>c.) IMPORTANT! As OuterBean is @Dependent, it will IMMEDIATELY destroyed 
>>after createUser() returns! See 6.4.2:
>>"any @Dependent scoped contextual instance created to receive a producer 
>>method, producer field, disposer method or
>>observer method invocation is destroyed when the invocation completes, and 
>>..." It might not be 100% clear if this means only the parameters of the 
>>producer method or also the containing bean as well though ... I remember 
>>that I talked about this with Pete a year or so ago and I think Weld also 
>>destroys the OuterBean immediately.
>>
>>So why the hack should we check if OuterBean is Serializable or not? It does 
>>NOT end up in the CreationalContext of the User u anyway. At least not if we 
>>assume the outlined interpretation of the spec ;)
>>
>>LieGrue,
>>strub
>>
>>
>>
>>----- Original Message -----
>>> From: Nikolai Dokovski <[email protected]>
>>> To: [email protected]
>>> Cc:
>>> Sent: Friday, May 18, 2012 12:52 PM
>>> Subject: Passivation dependencies of producer method are not validated
>>>
>>
>>> Hi,
>>> I got JSR 299 TCK (webprofile) running with tomcat and openwebbeans-1.1.4
>>> and there is one other test that fails
>>> PassivatingProducerMethodWithNonPassivatingParameterTest
>>>
>>> The case is simple: The container should respond with deployment exception
>>> when there is bean in passivating scope with dependencies which are not.
>>> After short debug session I ended up to invocation of
>>> AbstractProducerBeans.validatePassivationDependencies which is left emty
>>> (no implementation)
>>> with the following comments:
>>> // don't call super.validatePassivationDependencies()!
>>> // the injection points of producers are the parameters of the
>>> producermethod.
>>> // since CDI-1.1 we must not check those for is serializable anymore.
>>>
>>> Is there any particular reason for not implementing this or the check is
>>> performed elsewhere?
>>>
>>> Regards
>>> Nikolai
>>>
>>
>
>
>

Reply via email to