Hi!
It's in my mind from some time. Now I share it with you.
Imagine situation of say, 3D concern which does sth before invoking core method. It's
applied directly on core classes (assuming OO is 2D)
Let's suppose someone wants to add 4th dimension concern directly on 3D concern. Its
aim would be to provide fault tolerance in a way, that if 3D concern fails, then we
should still keep running our core system, but without 3D concern applied.
To implement it in JBossAOP one must intercept all execution of advices of 3D concern
and surround it with some try()..catch() block.
3D concern (actual state):
public Object 3DAdvice(...)
| {
| if (doSomething());
| invocation.invokeNext(); <- this is core method (2D)
| }
| }
Fault tolerant 4D concern (actual state):
public Object failTolerance4DAdvice(...)
| {
| try
| {
| invocation.invokeNext();
| }catch (SomeNastyException ...)
| {
| //continue running system... means proceed to the "core" method
| //which may be impossible with current JBossAOP
| ??? return invocation.invokeNextAfter3D(); ???
|
| }
| }
In AspectJ style and maybe with JBossAOP future style, one would use "before" advice
style for 3D concern..
3D concern (after/before state):
public Object before3DAdvice(...)
| {
| doSomething();
| }
Fault tolerant 4D concern (after/before state) then would be simple:
public Object failTolerance4DBeforeAdvice(...)
| {
| try
| {
| invocation.invokeNext();
| }catch (SomeNastyException ...)
| {
| //continue running system... means proceed to the "core" method,
| //means: "do nothing because we are "on" before advice"
| //and next invocation in chain is "core"
| }
| }
What do you say on that?
Or maybe there is some nice looking way for invoking invocation after next invocation
(which could solve lack "before" problem)?
Regards, Tomasz
PS. Anyway, emulation of "after" and "before" with "around only" is ugly.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3849402#3849402
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3849402
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development