[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [aspectj-users] Removing functionality with AspectJ?
|
Title: Message
Hi
Rob,
Instead of a "before" advice, use an "around" advice. With an
around advice you need to call the method proceed() to run the
original method. Thus in your advice if the security test allows the
method to proceed you call the proceed() keyword, otherwise
skip.
Regards,
Fintan
Hi there,
I'm completely new to AspectJ and was wondering if there is anyway to
cause a method to be "skipped" with AspectJ.
Apologies if the question sounds silly, but I am using AspectJ to monitor
what is going on in an object for security purposes.
If certain conditions have been met, a rule engine implemented in a
before advice determines that the code in that method should be skipped.
Naturally, for this to be in anyway feasible, the method in question would
need not to return anything, something like
public
void action()
I guess I need something like a decorator pattern that
removes functionality rather than adds it. The only way I can currently think
do to this is to use my aspect to change the value of a boolean variable
in the target method which causes the code to exit without doing anything.
Really appreciate your help
Thanks
Rob
* ** *** ** * ** *** ** * ** *** ** *
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.
Any views or opinions presented are solely those of the author, and do not necessarily
represent those of ESB.
If you have received this email in error please notify the sender.
Although ESB scans e-mail and attachments for viruses, it does not guarantee
that either are virus-free and accepts no liability for any damage sustained
as a result of viruses.
Company Registration Information: http://www.esb.ie/companies
* ** *** ** * ** *** ** * ** *** ** *