<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Le lun. 20 juil. 2015 à 15:31, Jozef Hartinger &lt;<a href="mailto:jharting@redhat.com">jharting@redhat.com</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As Martin explained, it is not the case that &quot;remote EJBs are not CDI<br>
beans&quot;.</blockquote><div><br></div><div>It&#39;s not written in black and white but in section 3.7 resources (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#resources">http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#resources</a>) ,  remote EJB are defined as resources and may can&#39;t be directly injected.</div><div>So if remote EJB are beans EntityManager or Web Services are as well. <br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Therefore, I am wondering why this behavior is a problem? AFAIK<br>
all the CDI implementations pass this test and therefore there may (at<br>
least in theory) be applications relying on this behavior.<br></blockquote><div><br></div><div>As said in my first mail, EJB spec sates (section 3.2.1)</div><div><br></div><div>&quot;The arguments and results of the methods of the remote business interface are passed by value.&quot;</div><div><br></div><div>I may be wrong but the observer in in the remote EJB is called with arguments passed by reference. So we are violating EJB specification.</div><div><br></div><div>So IMO we should do something about this. Because the original concern of Bill was about beans injected in remote method observer parameters and how they were copied.</div><div><br></div><div>Any thought?</div><div><br></div><div>Antoine</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Jozef<br>
<br>
On 16.7.2015 15:25, Antoine Sabot-Durand wrote:<br>
&gt; Hi guys,<br>
&gt;<br>
&gt;<br>
&gt; Bill Shanon, just pointed me to this test in TCK:<br>
&gt;<br>
&gt; <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" rel="noreferrer" target="_blank">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</a><br>
&gt;<br>
&gt; It tests the following assertion:<br>
&gt;<br>
&gt; &quot;If the bean is a session bean, the observer method must be either a<br>
&gt; business method of the EJB or a static method of the bean class.”<br>
&gt;<br>
&gt; The EJB containing the observers for the test is:<br>
&gt;<br>
&gt; <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" rel="noreferrer" target="_blank">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</a><br>
&gt;<br>
&gt; The EJB contains one business method coming from a local interface, one<br>
&gt; from a remote and one static method. the 3 are observers methods<br>
&gt;<br>
&gt; The test expects that the remote business observer method should be called.<br>
&gt;<br>
&gt; Here we have an inconsistency IMO. By doing this we are violating rules<br>
&gt; the CDI spec regarding the fact that remote EJBs are not CDI beans. And<br>
&gt; we are calling this remote business method passing the event payload by<br>
&gt; reference and not by value which violates EJB specification regarding<br>
&gt; remote EJB.<br>
&gt;<br>
&gt; I suggest that we change the assertion to:<br>
&gt;<br>
&gt; If the bean is a session bean, the observer method must be either a<br>
&gt; local business method of the EJB or a static method of the bean class.<br>
&gt;<br>
&gt; and the TCK accordingly. Any thought ?<br>
&gt;<br>
&gt; Antoine<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; cdi-dev mailing list<br>
&gt; <a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
&gt;<br>
&gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
&gt;<br>
</blockquote></div></div>