[seam-dev] Broken validation or broken booking example ?

pmuir at redhat.com pmuir at redhat.com
Sat Nov 1 08:34:11 EDT 2008


Sorry

--
Pete Muir
http://in.relation.to/Bloggers/Pete

On 1 Nov 2008, at 10:09, "Max Rydahl Andersen"  
<max.andersen at redhat.com> wrote:

> Ok, that is what we are validating today.
>
>> In seam 2, if you have exactly one @destroy method, it is  
>> automagically made the @destroy method.
>
> Yes, that is clear ;)
>
> I guess you meant to write:

No I meant

>
>
> In seam 2, if you have exactly one @remove method, it is  
> automagically made the @destroy method.



>
>
> Correct ?
>
> So in the case where i only have a @remove method and no @destroy  
> should that be
> marked as an error ?

Other way around.

>
>
> And I guess we could mark @Remove @Destroy methods with a warning  
> saying that the @Remove annotation is
> redundant (In Seam 2 only)

No, as if you have multiple @remove methods you need @destroy. Also  
@remove @destroy methods must have no parameters.

>
>
> /max
>
>>
>> --
>> Pete Muir
>> http://in.relation.to/Bloggers/Pete
>>
>> On 31 Oct 2008, at 21:00, "Max Rydahl Andersen" <max.andersen at redhat.com 
>> > wrote:
>>
>>> So just to be sure we are on the same page here:
>>>
>>> Under Seam 1.x
>>> Valid:
>>> @Remove @Destroy
>>> public void destroy() {}
>>>
>>> Invalid:
>>> @Remove
>>> public void destroy() {}
>>>
>>> @Destroy
>>> public void destroy() {}
>>>
>>> Under Seam 2.x
>>> Valid:
>>> @Remove @Destroy
>>> public void destroy() {}
>>>
>>> @Remove
>>> public void destroy() {}
>>>
>>> Invalid:
>>> @Destroy
>>> public void destroy() {}
>>>
>>> or is just having a @Destroy ok ?
>>>
>>> /max
>>>
>>>
>>>> On 31 Oct 2008, at 12:18, Max Rydahl Andersen wrote:
>>>>
>>>>>> We changed the rule, probably post SF.
>>>>>>
>>>>>> If you have a single method marked @Remove, it is assumed it is  
>>>>>> the @Remove @Destroy method.
>>>>>
>>>>> ok, so both the validation and docs are incorrect ?
>>>>
>>>> Yup, looks like the Seam 2 docs are wrong regarding this.
>>>>
>>>>>
>>>>>
>>>>> Maybe the validation is correct for Seam 1.x projects and
>>>>> only wrong for Seam 2 ?
>>>>
>>>> Can't remember when Gavin changed this. But it looks that way for  
>>>> me.
>>>>
>>>>>
>>>>>
>>>>> /max
>>>>>
>>>>>> On 31 Oct 2008, at 11:56, Max Rydahl Andersen wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> In Tools we implemented long ago a validation based on docs  
>>>>>>> and what you guys told us in SF:
>>>>>>>
>>>>>>> https://jira.jboss.org/jira/browse/JBIDE-554
>>>>>>> "All stateful session bean Seam components must have a method  
>>>>>>> marked @Remove @Destroy to ensure that Seam will remove the  
>>>>>>> stateful bean when the Seam context ends, and clean up any  
>>>>>>> server-side state."
>>>>>>>
>>>>>>> Recently we created the Project Example wizard and we wanted  
>>>>>>> to use the booking example as an example.
>>>>>>> I was surprised to find that our validator complained about  
>>>>>>> the code because in there all @Stateful beans get the Error:
>>>>>>>
>>>>>>> "Stateful component "<takeyourpick>List" must have a method  
>>>>>>> marked @Destroy
>>>>>>>
>>>>>>> and that is true since the code looks like this:
>>>>>>>
>>>>>>> @Remove
>>>>>>> public void destroy() {}
>>>>>>>
>>>>>>> where it should be:
>>>>>>>
>>>>>>> @Remove @Destroy
>>>>>>> public void destroy() {}
>>>>>>>
>>>>>>> My question now is:
>>>>>>>
>>>>>>> Is that validation rule broken (and the docs are wrong) or is  
>>>>>>> the booking example broken ?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> --/max
>>>>>>> _______________________________________________
>>>>>>> seam-dev mailing list
>>>>>>> seam-dev at lists.jboss.org
>>>>>>> https://lists.jboss.org/mailman/listinfo/seam-dev
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --/max
>>>>
>>>
>>>
>>>
>>> --/max
>
>
>
> -- 
> /max



More information about the seam-dev mailing list