Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] flow of execution in different threads

If I'm not mistaken, this works because the threads share the same aspect
instance: it's basically a singleton-ish thing (MyAspect.aspectOf()...).
This will work as long as you stay within certain borders. Does your
solution work across classloader, maybe even VM borders? That's usually the
big problem in J2EE environments...

> -----Oorspronkelijk bericht-----
> Van: aspectj-users-admin@xxxxxxxxxxx 
> [mailto:aspectj-users-admin@xxxxxxxxxxx] Namens Conway. 
> Fintan (IT Solutions)
> Verzonden: vrijdag 18 maart 2005 12:58
> Aan: 'aspectj-users@xxxxxxxxxxx'
> Onderwerp: RE: [aspectj-users] flow of execution in different threads
> 
> 
> For those of you who are interested - here is the output of a 
> sample run done on my PC.
> 
> 
> ? 	[main] leaf()
> ? 	[main] Aspect.<init>()
> ? 	[main] root()
> ? 	[main] void Main.leaf() state=Main[One]
> ? 	[main] leaf()
> ---> [main] create()
> ? 	[Thread-0] Aspect.<init>()
> ? 	[Thread-0] run()
> ? 	[Thread-0] void Main.leaf() state=Main[One]
> ? 	[Thread-0] leaf()
> <--- [main] create()
> ? 	[main] leaf()
> ? 	[main] Aspect.<init>()
> ? 	[main] root()
> ? 	[main] void Main.leaf() state=Main[Two]
> ? 	[main] leaf()
> ---> [main] create()
> ? 	[Thread-1] Aspect.<init>()
> ? 	[Thread-1] run()
> ? 	[Thread-1] void Main.leaf() state=Main[Two]
> ? 	[Thread-1] leaf()
> <--- [main] create()
> 
> 
> 
> 
> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx 
> [mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of > Matthew Webster
> Sent: 18 March 2005 11:32
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] flow of execution in different threads
> 
> 
> There have been a number of questions about determining cflow 
> across threads e.g. is a join point one thread in the control 
> flow of a join point on the thread that created me and can I 
> pass context. Here is an example of how to do it with 
> read-only state. The Main class has 2 methods leaf() and 
> root(). The "root()" method executes "leaf()" on another 
> thread. We want to obtain state in "leaf()" from earlier in 
> the control flow, in this case an instance of the Main class, 
> which is done using a percflow aspect and a Hashmap. The 
> root, lead, create and run pointcuts could be customized or 
> made abstract. Comments welcomed:
> 
> 
> * ** *** ** * ** *** ** * ** *** ** * 
> 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. 
>  
> * ** *** ** * ** *** ** * ** *** ** *
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx 
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
> 



Disclaimer:
This message contains information that may be privileged or confidential and is the property of Sogeti Nederland B.V. or its Group members. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.



Back to the top