[weld-dev] How to avoid classes being picked as managed beans?

aalmiray aalmiray at yahoo.com
Wed Mar 9 11:03:25 EST 2011


Hello guys. I'm new to Weld and CDI, perhaps the subject of this message is a
bit obvious to some of you but for the life of me couldn't find a portable
solution to the following problem: Weld will pick up all classes of an
application (found in a single jar that contains an empty beans.xml file),
however I would like the container to cherry pick a set of classes based on
some criteria (package name, class name convention, annotation, etc).

I've seen that Weld has an extension (non-standard) that allows classes to
be annotated with @Veto. It works fine but it poses to additional problems:
- @Veto is Weld specific
- you must annotate each class explicitly, which causes trouble with some
classes I have in my app as they are Groovy scripts, thus I can't annotated
them (Groovy script do get compiled to class files but you don't actually
'see' the class definition, it is generated by the compiler, thus the
annotation could only be added by a compiler plugin that rewrites the
generated AST (yes, it can be done but it's a heck of a Yak shaving at this
point)).

So, is there a way to specify which classes should be included/excluded in a
more generic, standard way?

TIA.
Andres

--
View this message in context: http://weld-development-discussions.46994.n3.nabble.com/How-to-avoid-classes-being-picked-as-managed-beans-tp2655829p2655829.html
Sent from the Weld development discussions mailing list archive at Nabble.com.


More information about the weld-dev mailing list