<div><br></div>It would be nice if the design made it easy for resources to be released when the beforePhase/afterPhase processing completes so developers don&#39;t inadvertently forget to release expensive resources.<div>
<br></div><div>I can see the need for the feature. There is a danger though, that it makes it too easy for developers to implement time &amp; resource expensive operations for invocations of the JSF lifecycle, which should be considered time sensitive.</div>
<div><br></div><div>- steve<br><br><div class="gmail_quote">On Tue, Jul 21, 2009 at 1:35 PM, Dan Allen <span dir="ltr">&lt;<a href="mailto:dan.jallen@gmail.com">dan.j.allen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Tue, Jul 21, 2009 at 1:08 PM, Kito Mann <span dir="ltr">&lt;<a href="mailto:kito.mann@virtua.com" target="_blank">kito.mann@virtua.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">

<div>On Tue, Jul 21, 2009 at 12:42 AM, Dan Allen <span dir="ltr">&lt;<a href="mailto:dan.j.allen@gmail.com" target="_blank">dan.j.allen@gmail.com</a>&gt;</span> wrote:<br></div><div class="gmail_quote"><div>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
One of the questions that is often raised when discussing Java EE integration (JSR-299 and EJB) is how to get a reference to a container-managed resource from within a JSF listener (e.g., EJB session bean, BeanManager, EntityManager). While Java EE certainly provides mechanisms to lookup up a resource, such as through JNDI, I think we need to restate the question at hand. Why is it that JSF listeners don&#39;t support Java EE resource injection like managed beans. Requiring this functionality in a Java EE environment would go a long way towards making JSF extensions (such as Seam or ADF) portable and generally make the effort of integration w/ container-managed resources easier.<br>



<br>With that said, I would like to propose for the next rev of the JSF specification that listeners, in addition to managed beans, support container injection and life-cycle callbacks when JSF is run in a Java EE environment (the rule for servlet containers would parallel that of managed beans today).<br>



<br>Listeners include:<br><br>PhaseListener<br>SystemEventListener<br>BehaviorListener? (not sure)</blockquote></div><div><br>So the easiest way to do this would be to accept an expression any time a listener is declared, correct? This is possible today with the &lt;f:view&gt; tag for PhaseListeners, but not in faces-config.xml. In the other cases, we do have support for expressions. </div>

</div></blockquote></div><div><br>I think you may be looking at it too narrowly. What we really want is for listeners to be managed beans, since most of the Java EE platform is going in that direction (and in some regards already there). We don&#39;t want something JSF-specific like EL expressions being passed in. What we really want is @PostConstruct, resource injection, etc. In other words, we want these classes to work within the context of the Java EE environment, rather than as outliers.<br>
<font color="#888888">
<br>-Dan<br></font></div></div><div><div></div><div class="h5"><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br>
<a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br>
<a href="http://in.relation.to/Bloggers/Dan" target="_blank">http://in.relation.to/Bloggers/Dan</a><br>
</div></div></blockquote></div><br></div>