1 Reply Latest reply on Sep 5, 2014 9:10 AM by Raj Haque

    CDI issue with abstract class.

    Raj Haque Newbie

      Hi All, I may be in the wrong side of the stick, But I need to do this, Can anybody help me please.

       

      I have these classes...

       

      interface A{

           void add();

            void sub();

      }

       

      class abtract B implements A{

           void add (){

               // do some stuff

           }

      }

       

      @stateless

      class C extends B{

           void sub(){

              // do something

            }

      }

       

       

      @stateless

      class D extends B{

           void sub(){

              // do something

            }

      }

       

       

      Then I want to use C and D with different facades. Like these...

      class X1 {

         @Inject private C  objC;

           void dosomehting(){

              // do something

            }

      }

      class X2 {

         @Inject private D  objD;

           void dosomehting(){

              // do something

            }

      }

       

       

      I tried to use Qualifiers(named and  annotations both) and alternatives  but I am not getting it right with none-satisfied dependencies or ambiguous dependency.

       

      Can I have here your valuable advice , please.

       

       

      Many Thanks