caelum/vraptor4 — pull request #311 by garcia-jj (2014-01-12 23:52:05+00:00)
Title: CDI manage only annotated beans

At this time, CDI manages all classes inside vraptor jar. And this may expensive.

By the CDI 1.1 spec: **It is strongly recommended you use "annotated"**. If the bean discovery mode is "all", then all types in this archive will be considered. If the bean discovery mode is "annotated", then **only those types with bean defining annotations will be considered**. If the bean discovery mode is "none", then no types will be considered.

I did some tests in my app and I see that with annotated memory usage was lower. If need, I can share results.

So I think that we don't need that all beans are managed. There are no technical issues to use discovery as annotated, and annotate beans that we want to be managed.