Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdi-dev] Extend lookup by method types and annotations?

Hi,

In CDI we currently have lookup capabilities to lookup by type, qualifiers, or a combination of this.

E.g.

CDI.current().select(SomeType.class, SomeQualifier.LITERAL);

However, not rarely we need to find beans with annotations on methods and/or methods with a type. For instance, consider the following code:

   @RequestScoped
    @ViewAction
    public class IndexPageBean {
     
      @FacesViewId("/index")
      public String execute() {
          ...    
      }
    }

We could select such bean with an extended lookup like:

CDI.current()
      .select(ViewAction.Literal.INSTANCE)
      .methods()
      .select(String.class, FacesViewId.Literal.of("/index");

Thoughts?

Kind regards,
Arjan Tijms





Back to the top