Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Is this possible in AspectJ

> public aspect myAspect{
>   public pointcut p1(..): call(..);
> }
>
> public aspect aspect2{
>     before(..) : p1(..){
>     }
> }
>
> Given that aspect2 kind of "import" myAspect?

Yes, you just need to qualify the name:

public aspect myAspect{
  public pointcut p1(): call(* *.println(..));
}

aspect aspect2{
  before() : myAspect.p1() { /* say myAspect.p1 */
  }
}

In the project I'm working on several of the classes have public pointcuts
just like this to make it easier for other aspects to use them.

-Macneil




Back to the top