0 Replies Latest reply on Dec 8, 2004 11:59 AM by Oliver Hakim

    user defined aspect with dynamic-aop

    Oliver Hakim Newbie

      Hi,

      I've got a little question concerning dynamic-aop!!!

      What I already did successfully is to use the dynamic-aop-API as it is described in the Tutorial (jbossaop_reference.pdf Chapter 6.1). Like this:

      org.jboss.aop.advice.AdviceBinding binding = new AdviceBinding("execution(POJO->new(..))", null);
      binding.addInterceptor(SimpleInterceptor.class);
      AspectManager.instance().addBinding(binding);
      

      In my code, I read the pointcut and the Interceptor class from an xml-file, I defined by myself, everything works fine.

      But in this case, there has to be a class SimpleInterceptor, that implements the Interceptor-Interface from JBoss-AOP and has a method called invoke...

      Another way to define an aspect is to write your own class, implementing no interface at all, but containing methods like this:

      public Object methodname(Invocation i)


      Then you just make an entry in jboss-aop.xml, that defines the class as an aspect and calls the method.


      My question is:
      Is there any possibility provide this feature with dynamic-aop??? There are some more explanations in the tutorial in Chapter 6.2, but I must admit, I don't really get that.

      Thanks for your help
      Regards from Germany
      OLLI