[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Problem with annotation based pointcut and inner classes
|
- From: "Andrew Eisenberg" <andrew@xxxxxxxxxxxx>
- Date: Wed, 27 Aug 2008 08:10:15 -0700
- Delivered-to: aspectj-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :sender:to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=fKq1c1OsL1Ewy9qtorhjQeGXvmFZCXoPKCQcQkMdf58=; b=Zgd5K1nq//kDDgTgEdZZJzYWttEuHZpdtPHaN3VroL8KvwAeIv3fz7cVF9cGmx+Fak 7xeADErSTV2ypOOTO+1Ed/gPVWH4T3ulIBNCOWw2mtzhNh1UlFK+EuqOqJpeZ894hz8Q 9sZKXIBoPD1taHcg1l1vY8ht9EpILgRiUEmeg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:sender:to:subject:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references:x-google-sender-auth; b=Aes3QlSv2m3Gw3g9KILoRwwccoaiRQHJmPqaDsEVBHx+COFPw0UeoeC9UqOVZrrT/C FX5mjZUxVyjogqEMgk8yOa3+fDShqcU823Ml64SRPc2fZAJqdeJ+5Mm8ps6/uXQoj1Cb E6kds4GvWkkMlDVo8ukqPk3LJDodVR4+zii8c=
Does this not work for you? The call to method() in main() is where
the advice is applied.
privileged aspect JetmMeasurement {
pointcut jetmMeasure(): call(@Jetm * *(..));
Object around(): jetmMeasure() {
System.out.println("hi!");
return null;
}
@interface Jetm {}
static class MyClass {
@Jetm Object method() {
return null;
}
public static void main(String[] args) {
new MyClass().method();
}
}
}
What is a simple version of the code you are trying to advise, but can't?
On Wed, Aug 27, 2008 at 1:50 AM, Christian Kölle
<christian.koelle@xxxxxxxxx> wrote:
> Hello
>
> I have a problem with an annotation based pointcut that should match
> annotated methods. Here's the aspect code:
>
> privileged aspect JetmMeasurement {
> pointcut jetmMeasure(): call(@Jetm * *(..));
>
> Object around(): jetmMeasure() {
> [...]
> }
>
> Unfortunately the pointcut doesn't work with annotated methods in inner
> classes. I tried some other matching pattern like call(@Jetm * *..*(..))
> but this didn't help.
>
> I'd appreciate any hints.
>
> Christian
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>