Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Challenge

As Antii writes, you can throw an exception to stop execution.
If you then create your own unchecked exception e.g. SystemUnavailableException and throw this, you can create a top level exception handler (in the web layer if on web) that tells your user to try again later, or something like that.

On Jun 13, 2007, at 10:47 AM, <hermod.opstvedt@xxxxxxxxx> <hermod.opstvedt@xxxxxxxxx> wrote:

Hi

Thnx for the clarification.

Hermod

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx]On Behalf Of Antti Karanta
Sent: Wednesday, June 13, 2007 10:34 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] Challenge




Using a before advice won't do it as far as I can tell. The
only way to change the return value (say return null f.ex.),
or throw something like a ResourceUnavailable exception would
be in a around advice. Using a before advice won't stop the
actual call (or will it?).

  You can throw exceptions from before advice, and doing so naturally
stops the actual call from happening.

  If you want to change the return value or not make the actual call
(e.g. get the value from cache), you have to use around advice.



      -Antti-


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

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email.

This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.

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



Back to the top