3 Replies Latest reply on Aug 21, 2009 11:34 PM by asookazian

    class level injection using custom annotation

    asookazian

      So this is a Seam 2 example that I'm wondering how 299/WB handles.


      I use this boilerplate code a lot in my Seam components:


      @In     
      private EntityManager entityManager;
           
      @Logger     
      private Log log;



      So in WB it would be:


      @PersistenceContext EntityManager userDatabase;
      
      @Current Logger log;



      So my idea (or request) is to inject n instances simultaneously using a custom annotation.


      something like this:


      @InjectPCandLogger
      public class foo{
      ...
      }



      Would this be implemented using a stereotype or is this a totally different idea/implementation (perhaps extending an abstract class)?


      The purpose of this is to reduce the amount of boilerplate code that we must write for each Web Bean component or Seam component.  Would work well when there's only one datasource for a particular app.