jsr345-experts@ejb-spec.java.net

[jsr345-experts] Re: Final methods in a bean class?

From: Pete Muir <pmuir_at_bleepbleep.org.uk>
Date: Thu, 28 Mar 2013 18:14:04 +0000

We updated the requirements in CDI to specifically exclude private methods from proxability requirements. Note we moved this to it's own section - 3.15

Pete

On 28 Mar 2013, at 17:16, Marina Vatkina <marina.vatkina_at_oracle.com> wrote:

> Well, Pete is on this list (and I'm cc-ing him here explicitly), but I don't think private final (or static final) methods should be restricted...
>
> -marina
>
> On 3/28/13 9:30 AM, Jeremy Bauer wrote:
>> Hi Marina,
>>
>> Won't allowing final methods will cause an inconsistency with the CDI spec? CDI 1.0 section 5.4.1 says:
>>
>> Certain legal bean types cannot be proxied by the container:
>> [...]
>> • classes which are declared final or have final methods,
>>
>> And I believe this is true in CDI 1.1, but I don't have that spec handy.
>>
>> -Jeremy
>>
>>
>>
>> From: Marina Vatkina <marina.vatkina_at_oracle.com>
>> To: jsr345-experts_at_ejb-spec.java.net,
>> Date: 03/27/2013 06:21 PM
>> Subject: [jsr345-experts] Re: Final methods in a bean class?
>>
>>
>>
>> After a longer discussion with Mark offline and not to allow users to
>> shoot themselves into a foot, the new proposal is to change both
>> statements as follow:
>>
>> (a) "All non-static public methods of the bean class and of any
>> superclasses except the java.lang.Object, are exposed as business methods."
>>
>> (b) "Business methods exposed through the no-interface view must not be
>> declared final."
>>
>> Let me know if anybody disagrees.
>>
>> thanks,
>> -marina
>>
>> On 3/27/13 11:36 AM, Marina Vatkina wrote:
>>> Experts,
>>>
>>> The EJB spec currently requires that if a bean exposes a no-interface
>>> view (see 4.9.8 Session Bean’s No-Interface View):
>>>
>>> (a) "All public methods of the bean class and of any superclasses
>>> except the java.lang.Object, are exposed as business methods through
>>> the no-interface view."
>>> (b) "All methods of the bean class and any superclasses must not be
>>> declared final."
>>>
>>> For all other views the rules for a *business method* is
>>> "The method must not be declared as final or static."
>>>
>>> Does any of you see a problem with removing the rule (b) and changing
>>> the rule (a) to:
>>>
>>> "All non-final non-static public methods of the bean class and of any
>>> superclasses except the java.lang.Object, are exposed as business
>>> methods through the no-interface view."
>>>
>>> thanks,
>>> -marina
>>>
>>>
>>
>>
>