[weld-dev] @WithAnnotations bug?

Kristoffer Sjögren stoffe at gmail.com
Tue Jan 28 05:14:15 EST 2014


Hi

Extensions that observe using @WithAnnotations are not notified with
implementing classes for annotated interfaces.

Not sure if this is intended - the javadoc seems pretty clear on that the
following example should work.

@Path("/service")
public interface Service {
  @POST
  public void execute();
}

public ServiceEndpoint implements Service {
   public void execute() { ... }
}

public class JaxrsExtension implements Extension {

<X> void storeJaxrsResourceClasses(@Observes @WithAnnotations({Path.class,
Provider.class}) ProcessAnnotatedType<X> pat) {
    AnnotatedType<X> type = pat.getAnnotatedType();
    if (!type.getJavaClass().isInterface()) {
       // want to manage the ServiceEndpoint here
    }
  }
}

Cheers,
-Kristoffer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20140128/8d9dc141/attachment.html 


More information about the weld-dev mailing list