Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to apply advice to an interface in a jar?

Hi Benyi,
you are trying to weave the JRE classes, which is quite tricky cause you have to weave the rt.jar at compie time and then run using the java bootclasspath option to use the weaved rt.jar. If you want to trace calls to lists only from inside your code, then try @Before("call(* java.util.List.*(..))") .

Simone

2010/5/18 Benyi Wang <bewang.tech@xxxxxxxxx>
How can add an advice to the methods of java.util.List?

I include the following into weaver options in aop.xml

<aspectj>
<aspects>
<aspect name="TestInterfaceAspect" />
</aspects>

<weaver options="-verbose -showWeaveInfo">
<include within="java.util.*"/>
</weaver>
</aspectj>

And

@Aspect
public class TestInterfaceAspect {

@Before("execution(* java.util.List.*(..))")
public void beforeListOperations(JoinPoint jp) {
System.out.println("Call " + jp.getSignature().toShortString());
}
}

but I always get a warning "advice defined in TestInterfaceAspect has not been appliedĀ [Xlint:adviceDidNotMatch]"?

I'm using Eclipse 3.5 with AJDT.

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top