<div dir="ltr"><div class="gmail_default" style="font-size:small">It is true the customer code has no interceptor binging.  We have no control over the EJB</div><div class="gmail_default" style="font-size:small">definition the user provides.  We do know that any interceptor class the customer provides</div><div class="gmail_default" style="font-size:small">in the @Interceptors annontation will have a @PostConstruct annotation.  Is it possible to</div><div class="gmail_default" style="font-size:small">programmatically associate an interceptor with that?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 23, 2019 at 4:06 AM Matej Novotny &lt;<a href="mailto:manovotn@redhat.com">manovotn@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I am not quite sure I follow what are you trying to achieve here.<br>
<br>
I can see you are trying to register a synthetic interceptor via WeldAfterBeanDiscovery.addInterceptor().<br>
What I am missing is how do you bind this interceptor to your PostConstructInjectionEJBResource?<br>
Because interceptors registered via WeldAfterBeanDiscovery are those that work on based on interceptor bindings and there is no binding on your Resource class.<br>
<br>
Could you elaborate a little please?<br>
Matej<br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Rebecca Searls&quot; &lt;<a href="mailto:rsearls@redhat.com" target="_blank">rsearls@redhat.com</a>&gt;<br>
&gt; To: <a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
&gt; Sent: Monday, July 22, 2019 8:37:16 PM<br>
&gt; Subject: [weld-dev] Creating default interceptor for EJBs<br>
&gt; <br>
&gt; <br>
&gt; Resteasy would like to address the following scenario with a default<br>
&gt; interceptor<br>
&gt; that is executed after classes defined in an @Interceptors stmt are executed.<br>
&gt; <br>
&gt; For example a customer provides an EJB with a defined @Interceptors stmt.<br>
&gt; <br>
&gt; @Path(&quot;/ejb&quot;)<br>
&gt; @Stateless<br>
&gt; @Interceptors ({PostConstructInjectionEJBInterceptor.class})<br>
&gt; public class PostConstructInjectionEJBResource {<br>
&gt; @Size(max=3)<br>
&gt; private String t = &quot;yz&quot;;<br>
&gt; <br>
&gt; @Path(&quot;get&quot;)<br>
&gt; @GET<br>
&gt; public String get() {<br>
&gt; return t;<br>
&gt; }<br>
&gt; <br>
&gt; public void setT(String t) {<br>
&gt; this.t = t;<br>
&gt; }<br>
&gt; }<br>
&gt; <br>
&gt; Resteasy provides a CDI extension class, ResteasyCdiExtension. This is where<br>
&gt; I am trying to made the addition. I&#39;ve reviewed the Weld docs and tried<br>
&gt; wrapping the class with an @Interceptor both with and without @Priority;<br>
&gt; using WeldAfterBeanDiscovery&#39;s addInterceptor method all without success.<br>
&gt; <br>
&gt; Would you provide advise as to how best to address this?<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; weld-dev mailing list<br>
&gt; <a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</blockquote></div>