0 Replies Latest reply on Apr 5, 2016 9:58 AM by Thomas Lauerbach

    How can I inject dependencies in a POJO like in Stateless Session Beans

    Thomas Lauerbach Newbie

      Hi,

       

      I habe a stateless session bean (on Wildfly 10), where POJOs a created by parameters coming from the database.

       

      @Stateless

      public MySessionBean implements myRemoteInterface {

      ..

      public void doSomething() {

        myPojo= Class.forName("pojo,class").getInstance();

        ...

      }

       

      Like in a session bean I'd like to annotate members of the POJO to be initialized after instanciation of the object. Best would be to use the same annotations, that are usable in a session bean (@EJB, @Resource, ...)

      How can I exactly do this? I didn't get the Point reading the spec of the weld Framework that looked like to be the solution for my Problem.

       

      Sincerely Thomas