[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [aspectj-users] only advise an object when its used in certain application scenarios
|
- From: Andrew Eisenberg <andrew@xxxxxxxxxxxx>
- Date: Sun, 20 Sep 2009 19:50:24 -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:mime-version:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=t7qc4rsAqRby6O/3GDLK8s7iHAmkZy9AyX0eoXxKLGk=; b=CQeEx1xF3H33M/9k7PZh5BtDoFSKmSTW+0CFRi+tkO5xhl4vQ/+GTJIisMwz+IWtK8 zVUahZtHkqSIGlHSmpOulxpfbcyw0ZtdBa55xXaFemlWFbbgTTu7kXz/mE9/NSZEIwAn duTqKlfXvH00xNLqtJaQKiax82Ze4rzchcrAM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=cFK0j7GXIsLI/fhK0rOLdX+4FtCqXM36hA8odYPdEch1B99fVWa9ofOIdreJ6LGA0u dUq7FBMjfY1ZgUiBci7qIEFmaKfRX7NxCO+uyB07U6Ru3+oezWTvIT2P5Cy+e59tiqxQ 3udLInEcKlsBQE/9I1vR+fvTvH/MTcBZx7Uuc=
Robert,
You would need to use a cflow pointcut. See
http://www.eclipse.org/aspectj/doc/released/progguide/quick.html#quick-pointcuts
You would want to do something like this:
pointcut uiTier() : within(com.foo.bar.ui..*);
pointcut personStuff() : within(Person);
before() : cflow(uiTier()) && personStuff() { ... }
On Sun, Sep 20, 2009 at 7:09 PM, Robert Taylor <rtaylor@xxxxxxxxxxxxxx> wrote:
> Greetings,
>
> I need to advise the same object only in certain scenarios of an
> application.
>
> For example,
> I have a model object, say Person.
>
> I use Hibernate to persist and retrieve Person objects.
>
> I do not want to advise certain getter/setter methods on Person, when it
> is in control of Hibernate framework.
>
> However, I do want to advise those getter/setter methods on Person when it
> is used in the UI tier. Essentially when the UI components retrieve
> information from
> Person or the UI components populate Person with information.
>
> I'm not sure how to define my point cuts for this situation (if it can be
> done).
>
> /robert
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>