2 Replies Latest reply on Feb 21, 2005 1:48 PM by Adrian Brock

    ClassAdapter spi

    Adrian Brock Master

      Rather than waiting for Bill to define this, I've made a first attempt
      at defining the ClassAdapter.

      I know Bill wanted to do extra stuff with Annotations here, but I've left
      that out for now since I can just pass a modified ClassInfo

      ClassAdapter getInstanceAdapter(ClassInfo)
      

      to notify aop I want instance level processing.

      Please review and comment, I'm going to plugin a reflection implementation
      to the MicroContainer such that the microcontainer is useable again.

      The MicroContainer will work from a "List" of ClassAdapters, i.e.
      it will ask AOPClassAdapter wether it recognises the class, if not
      it will ask ReflectedClassAdapter to do the processing.

      But there will be additional use cases where the user might want
      a non advised class to become advised either through a proxy instance
      advisor or runtime instrumentation. I have left this undefined for now.

        • 1. Re: ClassAdapter spi
          Adrian Brock Master

          The class is org.jboss.classadapter.spi.ClassAdapter.

          The MicroContainer will use it as follows.

          DESCRIBE (when class is available - but not necessarily loaded yet):
          1) Determine ClassAdapter (AOP or Reflected)
          2) Get ClassInfo and override annotations as appriopriate
          3) If overriding annotations at instance level, obtain an instance ClassAdapter
          with the overridden ClassInfo.
          4) Ask the ClassAdapter to augment dependencies with any information
          from the Annotations.

          INSTANTIATE (now that dependencies are satisfied)
          1) Ask the ClassAdapter (could be instance) for the JoinpointFactory
          2) Use the JoinpointFactory to construct the instance

          • 2. Re: ClassAdapter spi
            Adrian Brock Master

            I've also introduced the notion of ClassAdapterFactory
            to more easily determine whether AOP will support
            the class.

            If it returns null, the microcontainer will just use plain
            reflection without a "container".