<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 <<a href="mailto:manovotn@redhat.com">manovotn@redhat.com</a>> 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>
> From: "Rebecca Searls" <<a href="mailto:rsearls@redhat.com" target="_blank">rsearls@redhat.com</a>><br>
> To: <a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
> Sent: Monday, July 22, 2019 8:37:16 PM<br>
> Subject: [weld-dev] Creating default interceptor for EJBs<br>
> <br>
> <br>
> Resteasy would like to address the following scenario with a default<br>
> interceptor<br>
> that is executed after classes defined in an @Interceptors stmt are executed.<br>
> <br>
> For example a customer provides an EJB with a defined @Interceptors stmt.<br>
> <br>
> @Path("/ejb")<br>
> @Stateless<br>
> @Interceptors ({PostConstructInjectionEJBInterceptor.class})<br>
> public class PostConstructInjectionEJBResource {<br>
> @Size(max=3)<br>
> private String t = "yz";<br>
> <br>
> @Path("get")<br>
> @GET<br>
> public String get() {<br>
> return t;<br>
> }<br>
> <br>
> public void setT(String t) {<br>
> this.t = t;<br>
> }<br>
> }<br>
> <br>
> Resteasy provides a CDI extension class, ResteasyCdiExtension. This is where<br>
> I am trying to made the addition. I've reviewed the Weld docs and tried<br>
> wrapping the class with an @Interceptor both with and without @Priority;<br>
> using WeldAfterBeanDiscovery's addInterceptor method all without success.<br>
> <br>
> Would you provide advise as to how best to address this?<br>
> <br>
> _______________________________________________<br>
> weld-dev mailing list<br>
> <a href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a><br>
> <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>