1 Reply Latest reply on Jan 6, 2005 11:53 AM by Scott Stark

    Default JBOSS transaction management

    Vincent MATHON Newbie

      Hi.

      Well, I was thinking about it. During writing some internall document for my company showing diffs between AspectJ and JBossAOP one of the first things to explain was the existence of Interceptor interface. Although I like the word "interceptor" more than "advice", but I don't like the thing that I can specify interceptors (advices) in two ways: by implementing Interceptor interface, or creating class (Aspect class). The difference between them is that "JBossAOP aspect" may consist of several interceptors (advices) - which is good - but what for do we need Interceptor then?

      So I propose to throw Interceptor away, and use "aspect classes".

      Another thing, when you decide not to throw Interceptor away (explain why) - remove 'getName()' method from Interceptor interface. That's cumbersome to use it - I always put getClass().getName() there...

      And, btw: theoretically aspect with one advice should equal the interceptor class. But once, I've switched Interceptor wich Aspect in my app, changed jboss-aop.xml accordingly - so it would work the same way - but I got strange exceptions, which I cannot provide right now. I use Interceptors for "safety" from that moment. But I wish there were only one way to specify advices, though...

      Tomasz