-
1. Re: Interception of Superclass and Interfaces
bill.burke Mar 12, 2004 3:17 PM (in response to alex_brasil)In DR2 you can do the following
class A
{
public void method1() {..}
}
class B extends A {}
method1 will be intercepted if you declare a methoind-pointcut on A.method1.
DR3 has been improved tremoundously. You can do instanceof in the pointcut expression. DR3 will be out next Wednesday.
DR3 example:
interface A
{
void method1();
}
public class B implements A {...}
[bind pointcut="execution(void $instanceof{A}->method1())"]
[interceptor class="SOmeInterceptor"/]
[/bind]
Bill -
2. Re: Interception of Superclass and Interfaces
alex_brasil Mar 12, 2004 3:57 PM (in response to alex_brasil)First of all, thanks for the fast answer.
"Bill Burke" wrote:
In DR2 you can do the following
class A
{
public void method1() {..}
}
class B extends A {}
method1 will be intercepted if you declare a methoind-pointcut on A.method1.
That I already knew, but what if B overide method1()? Will DR3 provide a way to catch the overiden method as well?"Bill Burke" wrote:
DR3 has been improved tremoundously. You can do instanceof in the pointcut expression. DR3 will be out next Wednesday.
DR3 example:
interface A
{
void method1();
}
public class B implements A {...}
[bind pointcut="execution(void $instanceof{A}->method1())"]
[interceptor class="SOmeInterceptor"/]
[/bind]
Bill
That's cool. Will it work for subclasses as well? Is there any document where I can learn more about the "bind" pointcut and "$instanceof" operator in JBossAOP?
Thanks,
Alex -
3. Re: Interception of Superclass and Interfaces
bill.burke Mar 12, 2004 4:37 PM (in response to alex_brasil)Doco for DR3? Working on it right now. If you checkout CVS head
cvs checkout jboss-head
$ cd jboss-head/aop
$ build dist
You will get a zip dist. In the dist docs/examples directory there are a bunch of examples. I'll be adding to this and documenting each example as well as updating all the doco on our website.
Next week these examples will be on our wiki as well as other doco on JBoss AOP DR3.
Bill