3 Replies Latest reply on Jan 2, 2007 1:37 PM by kabirkhan

    Aspect concept in JBoss AOP

    fabiocsilva

      "Aspect" in JBoss AOP is internally transformed in "Interceptor" ? How to a aspect work in JBoss AOP?

        • 1. Re: Aspect concept in JBoss AOP
          kabirkhan

          An aspect is a class containing one or more advice methods, which must have the signature

          public Object <any-name>(Invocation inv) throws Throwable

          The invocation argument must be of type org.jboss.aop.joinpoint.Invocation, or one of its subclasses.

          An interceptor is a special type of aspect, and implements the org.jboss.aop.advice.Interceptor interface, which effectively forces you to create an aspect with one advice method.

          • 2. Re: Aspect concept in JBoss AOP
            fabiocsilva

            But dynamic aop is possible with aspects ? Or aspects would have to implement Interceptor interface for this purpose?

            • 3. Re: Aspect concept in JBoss AOP
              kabirkhan

              In 1.5.x, dynamic AOP is most easily possible with interceptors.

              In 2.0 it will be possible with everything. However, having said that you might be able to do it with 1.5.x as well. Take a look at org.jboss.aop.advice.PerVmAdvice, it is used to generate interceptor classes from aspects (in 1.5.x interceptors are used internally)