0 Replies Latest reply on Sep 16, 2010 9:42 AM by Andrea Giovannini

    Custom class loader?

    Andrea Giovannini Newbie

      I have an existing J2EE application without any dependency injection, so if class A uses class B then in class A I have

      public class A {}
          . . .
          B b = new B();
          . . .

      and if I want to sobstitute B with C (which extends B) I have to modify class A.
      I don't want to modify the entire application but I'd like to intercept class loading in order to replace on the fly class B with class C. Is this possible in JBoss? Can I replace the class loader with a custom one?

      Thanks in advance,