<div dir="ltr"><div class="gmail_extra"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div></div></div></div></div></div><div class="gmail_quote">2015-08-25 16:40 GMT+02:00 arjan tijms <span dir="ltr">&lt;<a href="mailto:arjan.tijms@gmail.com" target="_blank">arjan.tijms@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
On Tue, Aug 25, 2015 at 4:05 PM, Romain Manni-Bucau<br>
&lt;<a href="mailto:rmannibucau@gmail.com">rmannibucau@gmail.com</a>&gt; wrote:<br>
&gt; For this last case a really elegant solution would be to just reuse<br>
&gt; @Observes to fire the message from the jms &quot;container&quot; listener and<br>
&gt; propagate it to the &quot;user&quot; listener. This would then allow to decouple the<br>
&gt; application listener from JMS.<br>
<br>
</span>That sounds great indeed.<br>
<br>
I&#39;m very likely missing something though, but I wonder using that<br>
preferred approach how a message is exactly delivered to all instances<br>
of a bean in a given scope?<br>
<br>
E.g.<br>
<br>
Suppose the JMS listener bean is @SessionScoped, and there are<br>
currently 3 active sessions. The event is then fired from a system<br>
thread (I assume, but is this correct?). Can CDI find all of the 3<br>
active sessions and then call the observer method for separate<br>
instances of the bean in those 3 sessions?<br>
<br></blockquote><div><br></div><div>CDI not sure but CDI implementations can for sure find the instances, that said I hope it will be forbidden and that only scopes linked the a message context (ie app scoped, maybe singleton, dependent and jms scopes would be allowed. I am not yet clear is request scoped should be supported or if we need a wider scope because of JMS protocol)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Or is this not how the feature is intended?<br>
<br>
Kind regards,<br>
Arjan Tijms<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
&gt;<br>
&gt; For client side having a custom qualifier supporting placeholding - a bit<br>
&gt; like jbatch for system properties - would be nice and would allow to skip<br>
&gt; JNDI which means enabling SE usage as well.<br>
&gt;<br>
&gt;<br>
&gt; Romain Manni-Bucau<br>
&gt; @rmannibucau |  Blog | Github | LinkedIn | Tomitriber<br>
&gt;<br>
&gt; 2015-08-25 15:51 GMT+02:00 Nigel Deakin &lt;<a href="mailto:nigel.deakin@oracle.com">nigel.deakin@oracle.com</a>&gt;:<br>
&gt;&gt;<br>
&gt;&gt; On 24/08/2015 21:24, John D. Ament wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hi Nigel!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Glad to hear from you.  Was wondering, is there a way to manually<br>
&gt;&gt; &gt; register listeners?<br>
&gt;&gt;<br>
&gt;&gt; The current proposal is is for the bean to start listening just as soon as<br>
&gt;&gt; it is created (by CDI), and for it to stop<br>
&gt;&gt; listening just before it is destroyed (by CDI).<br>
&gt;&gt;<br>
&gt;&gt; As you suggesting that CDI would create the listener, but the application<br>
&gt;&gt; would call some method to tell it to start<br>
&gt;&gt; listening? or did you have something else in mind?<br>
&gt;&gt;<br>
&gt;&gt;  &gt; It would be great if this could<br>
&gt;&gt; &gt; be leveraged in a CDI SE environment as well as EE environment.<br>
&gt;&gt;<br>
&gt;&gt; I see that work is underway for CDI 2.0 to define how CDI might work in a<br>
&gt;&gt; Java SE environment. I don&#39;t see why a similar<br>
&gt;&gt; portable extension could not be created for use in Java SE. Since there<br>
&gt;&gt; would be no need to support Java EE behaviour<br>
&gt;&gt; such as transactions this could be built directly on top of the JMS<br>
&gt;&gt; provider&#39;s Java SE client. No need to use a resource<br>
&gt;&gt; adapter. However since the @JMSListener and @JMSConnectionFactory<br>
&gt;&gt; annotations use JNDI there would be a need to be a way<br>
&gt;&gt; to specify which JNDI InitialContext to use. I&#39;m not proposing any of this<br>
&gt;&gt; at the moment, but it might perhaps be<br>
&gt;&gt; something that we (the JMS expert group) could consider later on as a<br>
&gt;&gt; optional part of JMS 2.1.<br>
&gt;&gt;<br>
&gt;&gt; There&#39;s also the Java EE application client to consider.<br>
&gt;&gt;<br>
&gt;&gt; Nigel<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; cdi-dev mailing list<br>
&gt;&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt;&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;&gt;<br>
&gt;&gt; Note that for all code provided on this list, the provider licenses the<br>
&gt;&gt; code under the Apache License, Version 2<br>
&gt;&gt; (<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<br>
&gt;&gt; provided on this list, the provider waives all patent and other intellectual<br>
&gt;&gt; property rights inherent in such information.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; cdi-dev mailing list<br>
&gt; <a href="mailto:cdi-dev@lists.jboss.org">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<br>
&gt; under the Apache License, Version 2<br>
&gt; (<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<br>
&gt; provided on this list, the provider waives all patent and other intellectual<br>
&gt; property rights inherent in such information.<br>
</div></div></blockquote></div><br></div></div>