In seam 1.2 a sfsb must have at least one method marked @remove and
exactly one marked marked @destroy ; it can be the same method.
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:
In seam 2, if you have exactly one @destroy method, it is automagically
made the
*@remove* method.
Correct ?
So in the case where i only have a @remove method and no @destroy should
that be
marked as an error ?
And I guess we could mark @Remove @Destroy methods with a warning saying
that the @Remove annotation is
redundant (In Seam 2 only)
/max
--
Pete Muir
http://in.relation.to/Bloggers/Pete
On 31 Oct 2008, at 21:00, "Max Rydahl Andersen"
<max.andersen(a)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(a)lists.jboss.org
>>>>>
https://lists.jboss.org/mailman/listinfo/seam-dev
>>>>
>>>
>>>
>>>
>>> --/max
>>
>
>
>
> --/max
--
/max