<div dir="ltr">Hi,<div><br></div><div>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.</div><div><br></div><div>I&#39;ve added a decorator in the following way:</div><div><br></div><div><br></div><div><div>AnnotatedType&lt;AutoApplySessionDecorator&gt; annotatedType = beanManager.createAnnotatedType(AutoApplySessionDecorator.class);</div><div>        </div><div>BeanAttributes&lt;AutoApplySessionDecorator&gt; beanAttributes = beanManager.createBeanAttributes(annotatedType);</div><div>        </div><div>Bean&lt;AutoApplySessionDecorator&gt; bean = beanManager.createBean(beanAttributes, AutoApplySessionDecorator.class, beanManager.getInjectionTargetFactory(annotatedType));</div><div>        </div><div>afterBeanDiscovery.addBean(bean);</div></div><div><br></div><div>Where the &quot;AutoApplySessionDecorator&quot; is an existing (non-scanned) decorator just used as an example.</div><div><br></div><div><br></div><div>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;)).</div><div><br></div><div>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.</div><div><br></div><div><br></div><div>Is there any other way to either enable a (synthetic) decorator programmatically, or to add Interceptors to a programmatically added Bean&lt;T&gt;?</div><div><br></div><div>Kind regards,</div><div>Arjan Tijms</div><div><br></div></div>