Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] advanced(?) percflow uses

What you are asking for in terms of a special cflow reduces to the problem of
wanting a pointcut to pick out the enclosing execution join point of some other
join point. Something like:

  enclosingexecution(foo())

where foo might be something like

  pointcut foo(): call(mumble) || call(frotz)

If you had that, then you could write:

  cflow(enclosingexecution(<<your calls>>))


The previous examples of wanting enclosing execution have turned around
synchronization, and wanting to say something like:

  around(~~): enclosingexecution(set(~~)) {
    <grab lock>
    proceed(~~);
    <release lock>
  }

Or something like that.

But on close examination its never been clear those examples would really
work, in the sense that they would be really useful. (I think the semantics
of enclosingexecution is clear enough.)

Could you say a bit more about your example? Maybe some code that suggests
enough about it that it would be clear it would really be useful? 

> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx 
> [mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Lendvai Attila
> Sent: Thursday, February 26, 2004 8:52 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] advanced(?) percflow uses
> 
> 
> 
> hi,
> 
> is there a way to define a percflow aspect so that it lives one level
> above the percflow expression? what i would like to do is to define a
> percflow aspect that is alive in the entire method from where a given
> set of other methods are called.
> 
> and on an even higher level: i would like to write a WarningCollector
> aspect that my session bean methods can fill up, and the ui 
> methods can
> query for warnings.
> 
> aspect WarningCollector percflow(sessionBeanMethods())
> {
> }
> 
> void someUIMethod()
> {
> 
>   someService.someEJBMethod();
> 
>   WarningCollector.aspectOf().getWarnings();
> 
>   // unfortunately on this level the aspect is not alive anymore
> }
> 
> the only solution i know of is to list not the ejb methods in the
> percflow() definition, but rather the methods that call any 
> ejb method.
> but this is not a nice way to do, error-prone, etc.
> 
> any ideas?
> 
> thanks in advance,
> 
> - 101
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 




Back to the top