4 Replies Latest reply on Apr 20, 2004 12:28 PM by Bill Burke

    Fluid AOP

    Bill Burke Master

      Blogged about this:

      http://jboss.org/jbossBlog/blog/bburke/?permalink=Fluid+AOP.html

      Thoughts anybody? I still need to understand when/how context classloader gets set in JBoss.

      Bill

        • 1. Re: Fluid AOP
          Scott Stark Master

          Pretty much the tcl is set whenever a call enters into a container, be it jmx, ejb, web. Its needed when transitioning from the microkernel into a deployment context that can introduce new classes or class versions due to a deployment.

          It would generally seem that the TCL is the more typical level at which you would want to associate aspects as at least the metadata is likely to be coming from the application context. I have been noticing some issues with using the TCL as a key due to the fact that we tend to have noop class loaders to differentiate deployment contexts, and it can be a little hard to control how certain searches for resources behave. Another thing that is difficult is cleaning up classes on redeployment. The java.lang.ClassLoader in at least sun's impl has a private array of the classes loaded that cannot be cleared by subclasses. What I'm seeing with extensive holders of the TCL is that its difficult to clear everything, and this can lead to the use of stale classes, and leaks when frameworks make use of caches keyed to class statics.

          Because there are a fair number of issues with the current class loading that cannot be changed, I'm thinking that we need to be looking at another thread context at the key rather than the thread context class loader.

          • 2. Re: Fluid AOP
            Bill Burke Master

            I've been thinking about this over the weekend, and what I think I"m going to add is the expansion of CFLOW. Currently CFLOW only looks at the Java call stack. I think I will expand it to look at our metadata chain, or configuration domains.

            http://jboss.org/wiki/Wiki.jsp?page=AnnotationsAndAnnotationsInPointcuts

            So, instead of just a method or contstructor within the call stack, it will try to resolve a metadata reference from the metadata chain. Since ThreadMetaData is in the metadata chain you can set up custom CFLOWs.

            One thing about this is that we'll probably want "stacked" ThreadMetaData. FOr instance, if we use ThreadMetaData to tag application boundaries, you'll probably be interested in previous values of this threadlocal value.

            Bill

            • 3. Re: Fluid AOP
              marc fleury Master

              well Scott is talking about just an abstract keyword (thread local) to identify a given configuration. Is that what you are talking about.

              • 4. Re: Fluid AOP
                Bill Burke Master

                Affirmative.