<div dir="ltr">+1, seems it is the way to fix several issues without introducing a lot of new concepts/API and in term of technical stack it is just standardizing what is there.</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">2016-03-02 22:48 GMT+01:00 Mark Struberg <span dir="ltr">&lt;<a href="mailto:struberg@yahoo.de" target="_blank">struberg@yahoo.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ProxyFactory…<br>
<br>
I’m really thinking about introducing something like javax.proxy, maybe as own sub-spec PDF…<br>
<br>
LieGrue,<br>
strub<br>
<div><div class="h5"><br>
<br>
&gt; Am 02.03.2016 um 16:31 schrieb arjan tijms &lt;<a href="mailto:arjan.tijms@gmail.com">arjan.tijms@gmail.com</a>&gt;:<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m trying to add decorators and/or interceptors to a Bean&lt;T&gt; that&#39;s added via an extension. There doesn&#39;t seem to be any way to add interceptors, but decorators seem almost possible.<br>
&gt;<br>
&gt; I&#39;ve added a decorator in the following way:<br>
&gt;<br>
&gt;<br>
&gt; AnnotatedType&lt;AutoApplySessionDecorator&gt; annotatedType = beanManager.createAnnotatedType(AutoApplySessionDecorator.class);<br>
&gt;<br>
&gt; BeanAttributes&lt;AutoApplySessionDecorator&gt; beanAttributes = beanManager.createBeanAttributes(annotatedType);<br>
&gt;<br>
&gt; Bean&lt;AutoApplySessionDecorator&gt; bean = beanManager.createBean(beanAttributes, AutoApplySessionDecorator.class, beanManager.getInjectionTargetFactory(annotatedType));<br>
&gt;<br>
&gt; afterBeanDiscovery.addBean(bean);<br>
&gt;<br>
&gt; Where the &quot;AutoApplySessionDecorator&quot; is an existing (non-scanned) decorator just used as an example.<br>
&gt;<br>
&gt;<br>
&gt; While this seems to work, the problem is with the enablement. @Priority is not processed in this way, since it&#39;s only read from an AnnotatedType that&#39;s been added to the deployment (see e.g. in Weld org.jboss.weld.bootstrap.BeanDeployer.processPriority(AnnotatedType&lt;?&gt;)).<br>
&gt;<br>
&gt; beans.xml is not really an option here due to the static nature of that and the fact that the decorator needs to be enabled dynamically here, plus that the implementation class of the decorator is a detail I would not like to expose to the application.<br>
&gt;<br>
&gt;<br>
&gt; Is there any other way to either enable a (synthetic) decorator programmatically, or to add Interceptors to a programmatically added Bean&lt;T&gt;?<br>
&gt;<br>
&gt; Kind regards,<br>
&gt; Arjan Tijms<br>
&gt;<br>
</div></div>&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 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>
<br>
<br>
_______________________________________________<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.</blockquote></div><br></div>