<div dir="ltr">well was thinking to both but I see it really nice to not rely only on annotation - and aligned with most specs - since sometimes you just want to either be able to rely on a loop or a custom config to register your listeners. Annotations are too rigid for such cases.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br><span style="font-size:small">Romain Manni-Bucau</span><br><a href="https://twitter.com/rmannibucau" target="_blank">@rmannibucau</a> |  <a href="http://rmannibucau.wordpress.com" target="_blank">Blog</a> | <a href="https://github.com/rmannibucau" target="_blank">Github</a> | <a href="https://www.linkedin.com/in/rmannibucau" target="_blank">LinkedIn</a> | <a href="http://www.tomitribe.com" target="_blank">Tomitriber</a></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2015-08-25 18:25 GMT+02:00 Nigel Deakin <span dir="ltr">&lt;<a href="mailto:nigel.deakin@oracle.com" target="_blank">nigel.deakin@oracle.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">John,<br>
<br>
On 25/08/2015 16:31, John D. Ament wrote:<br>
<span class="">&gt;<br>
&gt;<br>
&gt; On Tue, Aug 25, 2015 at 9:51 AM Nigel Deakin &lt;<a href="mailto:nigel.deakin@oracle.com">nigel.deakin@oracle.com</a> &lt;mailto:<a href="mailto:nigel.deakin@oracle.com">nigel.deakin@oracle.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 24/08/2015 21:24, John D. Ament wrote:<br>
&gt;      &gt;<br>
&gt;      &gt; Hi Nigel!<br>
&gt;      &gt;<br>
&gt;      &gt; Glad to hear from you.  Was wondering, is there a way to manually register listeners?<br>
&gt;<br>
&gt;     The current proposal is is for the bean to start listening just as soon as it is created (by CDI), and for it to stop<br>
&gt;     listening just before it is destroyed (by CDI).<br>
&gt;<br>
&gt;     As you suggesting that CDI would create the listener, but the application would call some method to tell it to start<br>
&gt;     listening? or did you have something else in mind?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hmm, this would mean that only app scoped beans would apply?<br>
&gt; It might be better to scan for the annotations and use that to start up the listener?<br>
<br>
</span>I was just making a guess at what you might had in mind by &quot;manually register listeners&quot;.<br>
<span class="HOEnZb"><font color="#888888"><br>
Nigel<br>
</font></span><span class="im HOEnZb"><br>
<br>
&gt;<br>
&gt;       &gt; It would be great if this could<br>
&gt;      &gt; be leveraged in a CDI SE environment as well as EE environment.<br>
&gt;<br>
&gt;     I see that work is underway for CDI 2.0 to define how CDI might work in a Java SE environment. I don&#39;t see why a similar<br>
&gt;     portable extension could not be created for use in Java SE. Since there would be no need to support Java EE behaviour<br>
&gt;     such as transactions this could be built directly on top of the JMS provider&#39;s Java SE client. No need to use a resource<br>
&gt;     adapter. However since the @JMSListener and @JMSConnectionFactory annotations use JNDI there would be a need to be a way<br>
&gt;     to specify which JNDI InitialContext to use. I&#39;m not proposing any of this at the moment, but it might perhaps be<br>
&gt;     something that we (the JMS expert group) could consider later on as a optional part of JMS 2.1.<br>
&gt;<br>
&gt;     There&#39;s also the Java EE application client to consider.<br>
&gt;<br>
&gt;     Nigel<br>
&gt;<br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
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>
</div></div></blockquote></div><br></div>