3 Replies Latest reply on Jun 22, 2005 6:57 PM by Bill Burke

    Matching pointcuts in lib/*.jar

    Albert Bachand Newbie

      Are/Can classes from jars in the lib (jboss/server/default/lib) directory loaded with the AOP class loader?

      I have defined an execution pointcut that should match a joinpoint that is located inside such a class but it doesn't seem to work.

      Basically, the jar contains a class A that defines a checkAccess() method. I then deploy a class B that extends A but does not override checkAccess(). Result: my pointcut "execution(public boolean $instanceof(x.y.z.A)->checkAccess())" doesn't match. The only way I can make it match is by adding a dummy checkAccess() method to B that simply calls super.checkAccess(). Any way around this problem?

      Thanks!

        • 1. Re: Matching pointcuts in lib/*.jar
          Bill Burke Master

          I don't have a lot of cycles right now, so.......

          Can you see if precompilation with AOPC works? Then we can narrow it down.

          BTW, AOP 1.3 is being released sometime in the next 2 days. There is a new load-time weaver that does not use any special classloader.

          • 2. Re: Matching pointcuts in lib/*.jar
            Albert Bachand Newbie

            Turns out the problem was on my end... But IMO, it should have worked anyway.

            It turns out, foo() was defined one level higher, in X, the superclass of A. So, even though B is an instance of A (and of X), since the method foo() is defined in X, it looks as though, I must use $instanceof(x.y.z.X) to match executions of foo().

            So what I have is class X that defines foo() and class A that extends X. Both in a jar, under lib. Then I deploy a class B that extends A and does not override foo(). In that case:

            execution(public boolean $instanceof(x.y.z.X)->foo()) WORKS
            execution(public boolean $instanceof(x.y.z.A)->foo()) does NOT work

            I haven't looked at the code but I'm guessing JBossAOP implements the latter pointcut by transforming only class A. So that the execution of foo() within class X isn't "seen". Is that right?

            • 3. Re: Matching pointcuts in lib/*.jar
              Bill Burke Master

              You are correct Zoid. We will be fixing this problem in 2.0.