Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] due to interface not advised

Hi Michael,

i dont quite follow - can you flesh out the example?  I just wrote:

---A.java---
interface Context {}
class ContextImpl implements Context {}

aspect X {
  pointcut selectSingletons(): execution(* d*(..));

  after(Context con): selectSingletons() && this(con) {
  }
}

class A {
  Context doSomething() { return null; }
  ContextImpl doSomethingElse() { return null; }
}

----

ajc -showWeaveInfo A.java
Join point 'method-execution(Context A.doSomething())' in Type 'A'
(A.java:11) advised by after advice from 'X' (A.java:6) [with runtime
test]
Join point 'method-execution(ContextImpl A.doSomethingElse())' in Type
'A' (A.java:12) advised by after advice from 'X' (A.java:6) [with
runtime test]

What is different between what I did and what you are saying?

Andy.

2009/5/12 Michael Rogger <Michael.Rogger@xxxxxxx>:
> Hi,
>
> I have for example this aspect:
>
> after( Context con ) : selectSingletons() && this(con){
> ...
> }
>
> Where Context is an interface.
>
> -If a method has as return type Context (infterface) it will be advised
> by aspectj.
> -If a method has as return type Context (class which implements
> interface) it will not be advised
>
> In theory this should work, any ideas?
>
> thanks
>
> --
> Michael Rogger
> STI Innsbruck (www.sti-innsbruck.at)
> University of Innsbruck
> ICT Technologiepark
> Technikerstr. 21a
> 6020 Innsbruck, Austria
>
> T +43 512 507 96844
> F +43 512 507 9872
> E michael.rogger@xxxxxxx
>
> Skype michael.rogger.work
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top