<tt><font size=2>&gt;<br>
&gt; &nbsp; &nbsp; Therefore, I am wondering why this behavior is a problem?
AFAIK<br>
&gt; &nbsp; &nbsp; all the CDI implementations pass this test and therefore
there may (at<br>
&gt; &nbsp; &nbsp; least in theory) be applications relying on this behavior.<br>
&gt;</font></tt>
<br>
<br><font size=2 face="sans-serif">I agree that we should not directly
change the behaviour as we will break customers relying on this behaviour.</font>
<br>
<br><font size=2 face="sans-serif">Many thanks,<br>
Emily<br>
===========================<br>
Emily Jiang<br>
WebSphere Application Server Liberty Profile development </font>
<br><font size=2 face="sans-serif">&nbsp;<br>
MP 211, DE3A20, Winchester, Hampshire, England, SO21 2JN<br>
Phone: &nbsp;+44 (0)1962 816278 &nbsp;Internal: 246278<br>
<br>
Email: emijiang@uk.ibm.com <br>
Lotus Notes: Emily Jiang/UK/IBM@IBMGB<br>
</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Jozef Hartinger &lt;jharting@redhat.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Antoine Sabot-Durand
&lt;antoine@sabot-durand.net&gt;, cdi-dev &lt;cdi-dev@lists.jboss.org&gt;,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">20/07/2015 16:07</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [cdi-dev]
Inconsistency in the spec regarding remote EJBs</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">cdi-dev-bounces@lists.jboss.org</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2><br>
<br>
On 20.7.2015 16:24, Antoine Sabot-Durand wrote:<br>
&gt;<br>
&gt;<br>
&gt; Le lun. 20 juil. 2015 à 15:31, Jozef Hartinger &lt;jharting@redhat.com<br>
&gt; &lt;</font></tt><a href=mailto:jharting@redhat.com><tt><font size=2>mailto:jharting@redhat.com</font></tt></a><tt><font size=2>&gt;&gt;
a écrit :<br>
&gt;<br>
&gt; &nbsp; &nbsp; As Martin explained, it is not the case that &quot;remote
EJBs are not CDI<br>
&gt; &nbsp; &nbsp; beans&quot;.<br>
&gt;<br>
&gt;<br>
&gt; It's not written in black and white but in section 3.7 resources<br>
&gt; (</font></tt><a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#resources"><tt><font size=2>http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#resources</font></tt></a><tt><font size=2>)
, &nbsp;remote<br>
&gt; EJB are defined as resources and may can't be directly injected.<br>
&gt; So if remote EJB are beans EntityManager or Web Services are as well.<br>
<br>
Section 3.7 talks about injecting *references* to resources. In case of
<br>
remote EJBs and web services this would be clients (stubs) for accessing
<br>
those components. This section does not say anything about the component
<br>
definitions themselves.<br>
<br>
&gt;<br>
&gt; &nbsp; &nbsp; Therefore, I am wondering why this behavior is a problem?
AFAIK<br>
&gt; &nbsp; &nbsp; all the CDI implementations pass this test and therefore
there may (at<br>
&gt; &nbsp; &nbsp; least in theory) be applications relying on this behavior.<br>
&gt;<br>
&gt;<br>
&gt; As said in my first mail, EJB spec sates (section 3.2.1)<br>
&gt;<br>
&gt; &quot;The arguments and results of the methods of the remote business<br>
&gt; interface are passed by value.&quot;<br>
&gt;<br>
&gt; I may be wrong but the observer in in the remote EJB is called with<br>
&gt; arguments passed by reference. So we are violating EJB specification.<br>
&gt;<br>
&gt; So IMO we should do something about this. Because the original concern<br>
&gt; of Bill was about beans injected in remote method observer parameters<br>
&gt; and how they were copied.<br>
<br>
I see. This is quite weird then.<br>
<br>
&gt;<br>
&gt; Any thought?<br>
&gt;<br>
&gt; Antoine<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Jozef<br>
&gt;<br>
&gt; &nbsp; &nbsp; On 16.7.2015 15:25, Antoine Sabot-Durand wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Hi guys,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Bill Shanon, just pointed me to this test
in TCK:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; </font></tt><a href="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"><tt><font size=2>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</font></tt></a><tt><font size=2><br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; It tests the following assertion:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; &quot;If the bean is a session bean, the
observer method must be either a<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; business method of the EJB or a static method
of the bean class.”<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; The EJB containing the observers for the
test is:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; </font></tt><a href="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"><tt><font size=2>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</font></tt></a><tt><font size=2><br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; The EJB contains one business method coming
from a local<br>
&gt; &nbsp; &nbsp; interface, one<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; from a remote and one static method. the
3 are observers methods<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; The test expects that the remote business
observer method should<br>
&gt; &nbsp; &nbsp; be called.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Here we have an inconsistency IMO. By doing
this we are violating<br>
&gt; &nbsp; &nbsp; rules<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; the CDI spec regarding the fact that remote
EJBs are not CDI<br>
&gt; &nbsp; &nbsp; beans. And<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; we are calling this remote business method
passing the event<br>
&gt; &nbsp; &nbsp; payload by<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; reference and not by value which violates
EJB specification regarding<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; remote EJB.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; I suggest that we change the assertion to:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; If the bean is a session bean, the observer
method must be either a<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; local business method of the EJB or a static
method of the bean<br>
&gt; &nbsp; &nbsp; class.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; and the TCK accordingly. Any thought ?<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Antoine<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; _______________________________________________<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; cdi-dev mailing list<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; cdi-dev@lists.jboss.org &lt;</font></tt><a href="mailto:cdi-dev@lists.jboss.org"><tt><font size=2>mailto:cdi-dev@lists.jboss.org</font></tt></a><tt><font size=2>&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/cdi-dev</font></tt></a><tt><font size=2><br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Note that for all code provided on this list,
the provider<br>
&gt; &nbsp; &nbsp; licenses the code under the Apache License, Version
2<br>
&gt; &nbsp; &nbsp; (</font></tt><a href="http://www.apache.org/licenses/LICENSE-2.0.html"><tt><font size=2>http://www.apache.org/licenses/LICENSE-2.0.html</font></tt></a><tt><font size=2>).
For all other<br>
&gt; &nbsp; &nbsp; ideas provided on this list, the provider waives all
patent and<br>
&gt; &nbsp; &nbsp; other intellectual property rights inherent in such
information.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt;<br>
_______________________________________________<br>
cdi-dev mailing list<br>
cdi-dev@lists.jboss.org<br>
</font></tt><a href="https://lists.jboss.org/mailman/listinfo/cdi-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/cdi-dev</font></tt></a><tt><font size=2><br>
<br>
Note that for all code provided on this list, the provider licenses the
code under the Apache License, Version 2 (</font></tt><a href="http://www.apache.org/licenses/LICENSE-2.0.html"><tt><font size=2>http://www.apache.org/licenses/LICENSE-2.0.html</font></tt></a><tt><font size=2>).
For all other ideas provided on this list, the provider waives all patent
and other intellectual property rights inherent in such information.</font></tt>
<br><font size=2 face="sans-serif"><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>