No, there's not real integration between CDI and PhaseListeners.
I'm not suggesting or even really requesting for such integration to be added to the CDI spec, etc. Unless it is appropriate and that is up to you guys. But I thought that some way to configure this for dev/prod would be really cool (e.g. @Alternatives, etc.) Otherwise, it becomes a PITA to handle this properly.
NKarlsson, thx for creating the JSF issue!
This is actually a general problem if you think about it. It is a envmt config problem for classes in general, not just classes implementing JSF-specific interfaces like in this case. How do we or should we handle this in EE 6?
Now I just read the @Install annotation section in SiA book. There is a debug attribute which indicates that the component should be installed only when Seam is operating in debug mode.
I don't see an @Install here: http://java.sun.com/javaee/6/docs/api/
So maybe in EE 7 there can be an @Install that has either the CDI or EJB container (or whatever container(s) that will be active for that spec/impl) install my LifeCycleListener if in the ejb-jar.xml or application.xml or beans.xml configs, etc. the debug flag is set to true.
Or is there such a concept already in EE 6?