Thanks Martin! We are trying to do what you suggested, however I need a way to easily identify a JavaEE component? I don't want to go through all classes to process them. I need to filter out non-JavaEE component classes as you have handled them.
The one solution I can think of is to build a static list but it is very urgly.
The following EE7 spec has made EE component classes very similar to CDI beans:
Per the CDI specification, dependency injection is supported on managed beans. There are currently three ways for a class to become a managed bean:
1.Being an EJB session bean component.
2.Being annotated with the ManagedBean annotation.
3.Satisfying the conditions described in the CDI specification.
Classes that satisfy at least one of these conditions will be eligible for full dependency injection support as described in the CDI specification.
Component classes listed in Table EE.5-1 that satisfy the third condition above, but neither the first nor the second condition, can also be used as CDI managed beans if they are annotated with a CDI bean-defining annotation or contained in a bean archive for which CDI is enabled. However, if they are used as CDI managed beans (e.g., injected into other managed classes), the instances that are managed by CDI may not be the instances that are managed by the Java EE container.
Thanks