[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] Object Graph using aspectj
|
- From: "Andrew Eisenberg" <andrew@xxxxxxxxxxxx>
- Date: Fri, 12 Dec 2008 08:42:32 -0800
- 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=I62xVmZ6mdaGpmtcIlgdlCLwFKEECk8b0/1Go0dyARk=; b=HgP11T8e246SBlHWr67oikcOuBnVIwn7vy1yiWL5ipoOlYxw8xCbdMlo87Dj2beawq E2FewH9jX3rFvTGkWx6ulh6AbSrz1IKAKyh4Z14qoe8C7XHoLFbplZNQ6qhLWSfxMJrH c3PpzC4ksp85W+OWx17tGAQxm4x3LGbO+BY84=
- 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=W2OC279mYdpwt9I1S+QGImWroTaeAVDwNFDlGaSuj4yHHb7yVfM8GU+1N8qZraGif2 O8j7237H6X3S9IPBf/xSHxW0t1kPrswsRU9qkkWA6kdRf8pmUQe29w88Bwj2ND2jG0au iIWnGPrAbzMIeTHpGTA44DhQeS4rFQEjlmTlM=
> For situation when any object adds/removes a reference to another object
>
> pointcut assignments(Object assigned, Object to):
>
> set(Object *.*) && args(assigned && target(to) &&
> !within(edu.testing.lib.*) ;
>
> seems to work accepts assignments with in methods. Any suggestions on how to
> do that?
Are you saying that this only works for assignments occurring outside
of methods? So, in initializers and field declarations? Doesn't make
sense. Can you be more specific?
>
> pointcut constructor() : (call(*.new(..)) || call(*.new())) &&
> !within(edu.testing.lib.*) ;
You need to bind these arguments. So, you want to do something like this:
pointcut constructor(Object caller, Object created) : (call(*.new(..))
|| call(*.new())) &&
!within(edu.testing.lib.*) && target(created) && this(caller);
after (Object caller) returning (Object created) : constructor(caller,
created) {
...
}