Re: [aspectwerkz-user] AOP advice execution sequence

akhilesh laddha <[email protected]> Wed, 21 Nov 2007 19:12:00 -0800 (PST)
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
--0-808432745-1195701120=:33669
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Alex,
  I would like to know, what would be the right approach to bring the parallel execution of advice functionality up in the solution. 
  Should I tweak the framework code or own solution (means create a thread in advice and execute localize concerns code in run method)?
   
  Code snippet to add in own solution---
   
  MyAdvice() 
  {
       MyConcerns concerns = MyConcerns ();
       new Thread(concerns).start();
  } 
   
   
   
  ------------------
  Class MyConcerns ()
  {
     public void run()
    {
      System.out.println("Log info");
    }
  }
   
  -----------------------------------
   
  Note - If we need to tweak in the framework code then where I need to do. Please do let me know.
   
  Thanks
Akhilesh
  
Alexandre Vasseur <[email protected]> wrote:
  yes you can code for that, but the AOP framework won't create any thread for you
those papers are about use case, and not about framework features


On 11/21/07, akhilesh laddha wrote:
>
> Alex,
> I have some doubt. Because, attached document section 5, 6 and 7 describes
> that AOP advice run in parallel with the application code.
>
> In this url
> http://www.sdtimes.com/editorial/opinion-20020101-01.html
> article explain in the same line.
>
> Still, my understanding is not clarified, because your reply defer from the
> article.
>
> Is that all Java AOP framework inherently not support parallel execution of
> advice with the application code?
>
> Please let me know.
>
> Thanks
> Akhilesh
> Alexandre Vasseur wrote:
> no it runs in the same code path - as if you wrote it
> this said it is easy to have your advice produce an async task that
> will be consumed by some thread queue if you want
> it is all up to you
> Alex
>
> On Nov 20, 2007 6:00 PM, akhilesh laddha wrote:
> >
> > Hi All,
> > I would like to get clarify my self about AOP advice execution sequence
> > along with the application code. Does AOP advice execute in parallel with
> > application methods for that cross cut defines?
> >
> > For example
> > Application method - foo() (for cross cut define)
> > Takes execution time T1
> > Advice – fooAdvice() takes t1 time
> >
> > If AOP advice runs sequentially with application code then additional
> > performance hit because of advice code execution.
> >
> > Total time will be – T1 +t1
> >
> > From my understanding it runs in parallel therefore it takes time equal to
> > whichever is higher for ex – T1
> >
> > Please correct my understanding
> >
> > Thanks
> > Akhilesh
> >
> >
> >
> > ________________________________
> > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try
> it
> > now.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>
> ________________________________
> Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it
> now.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email



       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.
--0-808432745-1195701120=:33669
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Alex,</SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I would like to know, what would be the right approach to bring the parallel execution of advice functionality up in the solution. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Should I tweak the framework code or own solution (means create a thread in advice and execute localize concerns code in run method)?<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Code snippet&nbsp;to add in own solution---<o:p></o:p></SPAN></div>  <div><SPAN s
 tyle="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">MyAdvice() <o:p></o:p></SPAN></div>  <div><SPAN
 style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">{<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp; MyConcerns concerns = MyConcerns ();<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp; new Thread(concerns).start();<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">} <o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">------------------<o:p></o:p></SPAN></div>  <div><SP
 AN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Class MyConcerns ()<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">{<o:p></o:p></SPAN></div>  <div><SPAN
 style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp; public void run()<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp; </SPAN><SPAN lang=DE style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: DE">{<o:p></o:p></SPAN></div>  <div><SPAN lang=DE style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: DE">&nbsp;&nbsp;&nbsp; System.out.println("Log info");<o:p></o:p></SPAN></div>  <div><SPAN lang=DE style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-ansi-language: DE">&nbsp; </SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN sty
 le="FONT-SIZE: 10pt; FONT-FAMILY: Arial">-----------------------------------<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div> 
 <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Note - If we need to tweak in the framework code then where I need to do. Please do let me know.<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks<BR>Akhilesh<o:p></o:p></SPAN></div>  <div><BR><B><I>Alexandre Vasseur &lt;[email protected]&gt;</I></B> wrote:</div>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">yes you can code for that, but the AOP framework won't create any thread for you<BR>those papers are about use case, and not about framework features<BR><BR><BR>On 11/21/07, akhilesh laddha <[email protected]>wrote:<BR>&gt;<BR>&gt; Alex,<BR>&gt;
  I have some doubt. Because, attached document section 5, 6 and 7 describes<BR>&gt; that AOP advice run in parallel with the application code.<BR>&gt;<BR>&gt; In this url<BR>&gt;
 http://www.sdtimes.com/editorial/opinion-20020101-01.html<BR>&gt; article explain in the same line.<BR>&gt;<BR>&gt; Still, my understanding is not clarified, because your reply defer from the<BR>&gt; article.<BR>&gt;<BR>&gt; Is that all Java AOP framework inherently not support parallel execution of<BR>&gt; advice with the application code?<BR>&gt;<BR>&gt; Please let me know.<BR>&gt;<BR>&gt; Thanks<BR>&gt; Akhilesh<BR>&gt; Alexandre Vasseur <[email protected]>wrote:<BR>&gt; no it runs in the same code path - as if you wrote it<BR>&gt; this said it is easy to have your advice produce an async task that<BR>&gt; will be consumed by some thread queue if you want<BR>&gt; it is all up to you<BR>&gt; Alex<BR>&gt;<BR>&gt; On Nov 20, 2007 6:00 PM, akhilesh laddha wrote:<BR>&gt; &gt;<BR>&gt; &gt; 
 Hi All,<BR>&gt; &gt; I would like to get clarify my self about AOP advice execution sequence<BR>&gt; &gt; along with the application code. Does AOP advice execute in parallel with<BR>&gt;
 &gt; application methods for that cross cut defines?<BR>&gt; &gt;<BR>&gt; &gt; For example<BR>&gt; &gt; Application method - foo() (for cross cut define)<BR>&gt; &gt; Takes execution time T1<BR>&gt; &gt; Advice – fooAdvice() takes t1 time<BR>&gt; &gt;<BR>&gt; &gt; If AOP advice runs sequentially with application code then additional<BR>&gt; &gt; performance hit because of advice code execution.<BR>&gt; &gt;<BR>&gt; &gt; Total time will be – T1 +t1<BR>&gt; &gt;<BR>&gt; &gt; From my understanding it runs in parallel therefore it takes time equal to<BR>&gt; &gt; whichever is higher for ex – T1<BR>&gt; &gt;<BR>&gt; &gt; Please correct my understanding<BR>&gt; &gt;<BR>&gt; &gt; Thanks<BR>&gt; &gt; Akhilesh<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; ________________________________<BR>
 &gt; &gt; Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try<BR>&gt; it<BR>&gt; &gt; now.<BR>&gt;<BR>&gt;
 ---------------------------------------------------------------------<BR>&gt; To unsubscribe from this list please visit:<BR>&gt;<BR>&gt; http://xircles.codehaus.org/manage_email<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; ________________________________<BR>&gt; Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it<BR>&gt; now.<BR>&gt;<BR>&gt;<BR>&gt; ---------------------------------------------------------------------<BR>&gt; To unsubscribe from this list please visit:<BR>&gt;<BR>&gt; http://xircles.codehaus.org/manage_email<BR>&gt;<BR>&gt;<BR><BR>---------------------------------------------------------------------<BR>To unsubscribe from this list please visit:<BR><BR>http://xircles.codehaus.org/manage_email<BR><BR></BLOCKQUOTE><BR><p>&#32;

      <hr size=1>Never miss a thing.  <a href="http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs"> Make Yahoo your homepage.</a>


--0-808432745-1195701120=:33669--