[cdi-dev] Inconsistency in the spec regarding remote EJBs
Antoine Sabot-Durand
antoine at sabot-durand.net
Thu Jul 16 10:49:12 EDT 2015
Yes Tomas I agree, I think it should be detected automatically by the
container so it's good to update 10.4.2 accordingly. The assertion you
mentioned match this test in the TCK:
https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/event/broken/observer/notBusinessMethod/EJBObserverMethodNotBusinessMethodTest.java
It's more straight forward to work there IMO.
Romain, I don't understand when you write "That said not being able to fix
it in EJB spec". It's not an EJB spec issue but a CDI issue.
Antoine
Le jeu. 16 juil. 2015 à 16:05, Romain Manni-Bucau <rmannibucau at gmail.com> a
écrit :
> hmm, this always has been an issue for me since CDI shouldnt know about
> these methods at all so how could it specify anything? That said not being
> able to fix it in EJB spec I tend to agree with Tomas.
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github
> <https://github.com/rmannibucau> | LinkedIn
> <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-07-16 15:56 GMT+02:00 Tomas Remes <tremes at redhat.com>:
>
>>
>> Hi,
>>
>> I agree. Shouldn't we specify what happens in opposite case? Or maybe
>> better to update following in "10.4.2. Declaring an observer method" as
>> well:
>>
>> "If a non-static method of a session bean class has a parameter annotated
>> @Observes, and the method is not a business method of the EJB, the
>> container automatically detects the problem and treats it as a definition
>> error."
>>
>> Tom
>>
>> ----- Original Message -----
>> From: "Antoine Sabot-Durand" <antoine at sabot-durand.net>
>> To: "cdi-dev" <cdi-dev at lists.jboss.org>
>> Sent: Thursday, July 16, 2015 3:25:40 PM
>> Subject: [cdi-dev] Inconsistency in the spec regarding remote EJBs
>>
>> Hi guys,
>>
>>
>> Bill Shanon, just pointed me to this test in TCK:
>>
>>
>> https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/ResolveEnterpriseEventObserverTest.java
>>
>> It tests the following assertion:
>>
>> "If the bean is a session bean, the observer method must be either a
>> business method of the EJB or a static method of the bean class.”
>>
>> The EJB containing the observers for the test is:
>>
>>
>> https://github.com/cdi-spec/cdi-tck/blob/1.2/impl/src/main/java/org/jboss/cdi/tck/tests/event/observer/resolve/enterprise/Spitz.java
>>
>> The EJB contains one business method coming from a local interface, one
>> from a remote and one static method. the 3 are observers methods
>>
>> The test expects that the remote business observer method should be
>> called.
>>
>> Here we have an inconsistency IMO. By doing this we are violating rules
>> the CDI spec regarding the fact that remote EJBs are not CDI beans. And we
>> are calling this remote business method passing the event payload by
>> reference and not by value which violates EJB specification regarding
>> remote EJB.
>>
>> I suggest that we change the assertion to:
>>
>> If the bean is a session bean, the observer method must be either a local
>> business method of the EJB or a static method of the bean class.
>>
>> and the TCK accordingly. Any thought ?
>>
>> Antoine
>>
>> _______________________________________________
>> cdi-dev mailing list
>> cdi-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/cdi-dev
>>
>> Note that for all code provided on this list, the provider licenses the
>> code under the Apache License, Version 2 (
>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
>> provided on this list, the provider waives all patent and other
>> intellectual property rights inherent in such information.
>>
>>
>>
>> _______________________________________________
>> cdi-dev mailing list
>> cdi-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/cdi-dev
>>
>> Note that for all code provided on this list, the provider licenses the
>> code under the Apache License, Version 2 (
>> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
>> provided on this list, the provider waives all patent and other
>> intellectual property rights inherent in such information.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20150716/74bd7f5b/attachment-0001.html
More information about the cdi-dev
mailing list