5 Replies Latest reply on Mar 31, 2008 7:13 PM by dro_k

    Advanced Injection Scenario

    dro_k

      Hi All,


      Does Seam have an equivalent of Spring's prototype scope and scoped-proxy combo? Spring Doc Link (Basically replacing Java's new operator plus context sensitive injections)


      If so, can I create a method scoped component and have Seam inject the current EntityManger in it?


      Bascially



      @Name
      public ComponentA {
          @PersistentContext
          EntityManager em;
      
          @In
          ComponentB b;
      
          public void act() {
              b.doSomethingWithEntityManager();
          }
      }
      
      public ComponentB {
          @In
          EntityManager em; //same entity manger of ComponentB
      
          public void doSomethingWithEntityManager() {
              em.something
          }
      }
      



      I think this should be possible using components.xml but I just don't know how.


      Thanks!