For documentation (not conversation) purposes -- this approach has already been discussed:<br><br>/**<br>  * A small non-portable Weld PoC enabler that does not take many factors (incl. class runtime availability) into account:<br>
  */<br>public class SeamInterceptorEnablerExtension implements Extension<br>{<br>   public void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event, final BeanManager manager)<br>   {<br>      if (manager instanceof BeanManagerImpl)<br>
      {<br>         BeanManagerImpl impl = (BeanManagerImpl) manager;<br><br>         // Enable interceptors in order here<br>         // enableInterceptor(impl, YourInterceptor1.class);<br>
         // enableInterceptor(impl, YourInterceptor2.class);<br>
         // enableInterceptor(impl, YourInterceptor3.class); ... and more<br>      }<br>   }<br><br>   private void enableInterceptor(final BeanManagerImpl impl, final Class&lt;?&gt; type)<br>   {<br>      List&lt;Class&lt;?&gt;&gt; list = new ArrayList&lt;Class&lt;?&gt;&gt;();<br>
      list.addAll(impl.getEnabledInterceptorClasses());<br><br>      list.add(type);<br><br>      impl.setEnabledInterceptorClasses(list);<br>   }<br>}<br><br><div class="gmail_quote">On Mon, Mar 29, 2010 at 4:02 PM, Nicklas Karlsson <span dir="ltr">&lt;<a href="mailto:nickarls@gmail.com">nickarls@gmail.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;">It would probably work for us but would be non-portable, right?<div><br></div><div>*IF* we go down the route of auto-enablement, it would probably be easy to have the Seam 3 config @Injected into the extension and check from a field if the enabling is turned on or off (set in XML or wherever) so no need to exclude/include jars.<div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Mon, Mar 29, 2010 at 10:50 PM, Ales Justin <span dir="ltr">&lt;<a href="mailto:ales.justin@gmail.com" target="_blank">ales.justin@gmail.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>&gt;&gt; That&#39;s why the JAR is included by default via Maven -- or provided in the<br>
&gt;&gt; &quot;Dump these jars into your app&quot; folder that we have in the Dist-releases. No<br>
&gt;&gt; extra work required to include it.<br>
&gt;<br>
&gt; And so I repeat my question: how is this better than a pre-written XML<br>
&gt; file that is included by default?<br>
<br>
</div>What is required for a class to be interceptor?<br>
(haven&#39;t been in JEE world for a while :-))<br>
<br>
Does it need to implement some interface?<br>
Or is proper api enough -- e.g. a plain class which has the right method?<br>
(in JBoss AOP, afair, it was enough to have single param method &quot;invoke&quot; with InvocationContext param)<br>
<br>
Just asking on how to easily recognize the interceptors,<br>
since I&#39;ve just written a single-pass scanning MC lib [1],<br>
where it would be trivial to add recognized interceptors by default to Weld&#39; metadata.<br>
(we already do/add a bunch of default things for things we recognize as Weld in JBossAS/MC)<br>
<br>
But I guess we then introduce ordering issue?<br>
<br>
[1] - no more need to do multiple scans in diff JBossAS components<br>
e.g. Hibernate Scanner impl: <a href="http://anonsvn.jboss.org/repos/jbossas/projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hibernate/" target="_blank">http://anonsvn.jboss.org/repos/jbossas/projects/scanning/trunk/plugins/src/main/java/org/jboss/scanning/hibernate/</a><br>


<div><div></div><div><br>
<br>
_______________________________________________<br>
seam-dev mailing list<br>
<a href="mailto:seam-dev@lists.jboss.org" target="_blank">seam-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br>---<br>Nik<br>
</div>
<br>_______________________________________________<br>
seam-dev mailing list<br>
<a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>&quot;Keep it Simple&quot;<br>