Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: Per-control-flow aspect question



Pavel,

My assumption is that your correlation ID is an integer and it is passed as
the first argument to each Facade method. The first thing to note is that
an "execution()" pointcut is the most common pattern for logging aspects as
it allows you to identify the class(es) to be logging rather that all their
callers. Secondly the logging behaviour i..e how to log show be separated
from the scope i.e. what to log. We use an abstract aspect to facilitate
this separation:

public abstract aspect Logging {

      public abstract pointcut loggingScope(int id);

      before (int id) : loggingScope(id) {
            Logger logger = getLogger(id);
            Signature sig = thisJoinPointStaticPart.getSignature();

logger.entering(sig.getDeclaringType().getName(),sig.getName());
      }

      after (int id) returning(Object ret) :  loggingScope(id) {
            Logger logger = getLogger(id);
            Signature sig = thisJoinPointStaticPart.getSignature();

logger.exiting(sig.getDeclaringType().getName(),sig.getName(),ret);
      }

      after (int id) throwing(Throwable th) :  loggingScope(id) {
            Logger logger = getLogger(id);
            Signature sig = thisJoinPointStaticPart.getSignature();
            logger.throwing
(sig.getDeclaringType().getName(),sig.getName(),th);
      }

      protected abstract Logger getLogger (int id);

}

The aspect above defines entry, exit and exception logging.

Next we can define the scope by providing a concrete implementation of the
"loggingScope()" pointcut as well as a logging factory method (I have used
JDK14 logging as an example):

public abstract aspect FacadeLogging extends Logging {

      public pointcut loggingScope (int id) :
            within(Facade) && args(id, ..);

      private Logger logger;

      protected Logger getLogger (int id) {
            if (logger == null) {
                  logger = Logger.getLogger("FacadeLogging." + id);
                  logger.setLevel(Level.FINER);
                  Handler handler = new ConsoleHandler();
                  handler.setLevel(Level.FINER);
                  logger.addHandler(handler);
                  return logger;
            }
            return logger;
      }
}

Finally we define a concrete aspect that will be instantiated for every
separate control flow in your session bean(s):

public aspect SessionBeanLogging extends FacadeLogging percflow(scope()) {

      pointcut scope () :
            execution(* SessionBean+.*(..));
}

This may seem a little complex but each aspect is reusable.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/


aspectj-users-request@xxxxxxxxxxx@eclipse.org on 26/05/2004 02:55:01

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:    aspectj-users-admin@xxxxxxxxxxx


To:    aspectj-users@xxxxxxxxxxx
cc:
Subject:    aspectj-users digest, Vol 1 #574 - 3 msgs


Send aspectj-users mailing list submissions to
             aspectj-users@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
             http://dev.eclipse.org/mailman/listinfo/aspectj-users
or, via email, send a message with subject or body 'help' to
             aspectj-users-request@xxxxxxxxxxx

You can reach the person managing the list at
             aspectj-users-admin@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of aspectj-users digest..."


Today's Topics:

   1. RE: ajdoc in Eclipse 3 M8 (AJDT 1.1.8) No packages or classes
specified (Mik Kersten)
   2. Per-control-flow aspect question (Pavel Kusch)
   3. AspectJ in large scale development projects. (jan casteels)

--__--__--

Message: 1
From: "Mik Kersten" <beatmik@xxxxxxxxx>
To: <aspectj-users@xxxxxxxxxxx>
Subject: RE: [aspectj-users] ajdoc in Eclipse 3 M8 (AJDT 1.1.8) No packages
or classes specified
Date: Tue, 25 May 2004 15:18:41 -0700
Reply-To: aspectj-users@xxxxxxxxxxx

This is a multi-part message in MIME format.

------=_NextPart_000_0036_01C4426B.90454850
Content-Type: text/plain;
             charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi Russ,



Did you get this working?  Regarding Eclipse the "irregularities" in the
Javadoc wizard's memory: you may be noticing that it saves the command
per-project and not per-workspace.  We could consider changing the command
path automatically when a project has the AspectJ Nature, but that would
involve knowing where your AspectJ install is or shipping a
platform-dependent script with the plugin.



Mik



  _____

From: aspectj-users-admin@xxxxxxxxxxx
[mailto:aspectj-users-admin@xxxxxxxxxxx] On Behalf Of Russell Miles
Sent: Thursday, May 13, 2004 10:43 AM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] ajdoc in Eclipse 3 M8 (AJDT 1.1.8) No packages
or classes specified



Hi George,

hmmm, no dice I'm afraid. Also there seems to be irregularities with the
Javadoc wizard not remembering the right tool that you selected. I checked
out the ajdoc command script file and it was already set to the % that you
mentioned. I'm totally foxed by this. Luckily I do have a laptop that is
effectively a clean system so maybe it's something to do with my setup and
a
clean install might help. I'll try that next...

Cheers,

Russ

On 13 May 2004, at 09:47, George Harley1 wrote:


Hi Russ,

Sounds like we need some more information about how you are using the
ajdoc.bat script. How many packages are we talking about here ? Are you
passing in any other options through the "Extra Javadoc options" panel ?

Recently it was noticed that the ajdoc.bat launch script on Windows XP was
limiting the number of arguments getting passed into the ajdoc main class.
If you are running on XP then as a quick check to see if this is the cause
of your problem you could go into the ajdoc.bat script and make a minor
alteration to the last line. Replace the "%1 %2 %3 %4 %5 %6 %7 %8 %9" with
"%*" (no quotes around it).

Best regards,
George
________________________________________
George C. Harley






Russell Miles <russellmiles@xxxxxxx>


Sent by: aspectj-users-admin@xxxxxxxxxxx



12/05/2004 22:34



Please respond to


aspectj-users





To


aspectj-users@xxxxxxxxxxx



cc



Subject


[aspectj-users] ajdoc in Eclipse 3 M8 (AJDT 1.1.8) No packages or classes
specified









Hi everyone,

This one has been bugging me for a while now and for the life of me I
can't seem to figure out what is wrong. I am using Eclipse 3 M8, AJDT
1.1.8 with AspectJ 1.2 on the machine. i am trying to generate the docs
using AJDoc which was working fine up until I put my source on a CVS
server and now I am getting the message 'No packages or classes
specified' every time I try to run the documentation generation. I am
also getting the 'Ignoring unsupported option: -use' message, is that
anything to do with it? I think I got that message before and the
source still generated ok. I've tried this out on my Mac and Windows
boxes (same environment setup) and still no joy.

I've checked the documentation creation wizard and everything seems to
be in order (all my sources seem selected), and things were working ok
before. Basically has anyone else had this problem? It just stinks of
being something silly I've done but any help in putting me right would
be great.

Cheers,

Russ

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


------=_NextPart_000_0036_01C4426B.90454850
Content-Type: text/html;
             charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas:contacts" =
xmlns:st2=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40";>

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}o\:*
{behavior:url(#default#VML);}w\:* {behavior:url(#default#VML);}.shape
{behavior:url(#default#VML);}</style><![endif]--><o:SmartTagType
namespaceuri=3D"urn:schemas:contacts"
 name=3D"middlename"/>
<o:SmartTagType namespaceuri=3D"urn:schemas:contacts" name=3D"Sn"/>
<o:SmartTagType namespaceuri=3D"urn:schemas:contacts" =
name=3D"GivenName"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"time"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"phone"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"date"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"PersonName"/>
<!--[if !mso]><style>st1\:*{behavior:url(#default#ieooui) =
}st2\:*{behavior:url(#default#ieooui) }</style><![endif]-->
<style>
<!-- /* Font Definitions */ @font-face    {font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}@font-face  {font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}@font-face {font-family:"\@MS Mincho";
panose-1:0 0 0 0 0 0 0 0 0 0;} /* Style Definitions */ p.MsoNormal,
li.MsoNormal, div.MsoNormal   {margin:0in;      margin-bottom:.0001pt;
font-size:12.0pt; font-family:"Times New Roman";}a:link, span.MsoHyperlink
{color:blue;      text-decoration:underline;}a:visited,
span.MsoHyperlinkFollowed     {color:purple;    text-decoration:underline;}
tt    {font-family:"Courier New";}span.EmailStyle18
{mso-style-type:personal-reply;     font-family:Tahoma;     color:blue;
font-weight:normal;     font-style:normal;      text-decoration:none none;}
@page Section1    {size:8.5in 11.0in;     margin:1.0in 1.25in 1.0in 1.25
in;}div.Section1  {page:Section1;}-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3DTahoma><span =
style=3D'font-size:
10.0pt;font-family:Tahoma;color:blue'>Hi <st1:GivenName =
w:st=3D"on">Russ</st1:GivenName>,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3DTahoma><span =
style=3D'font-size:
10.0pt;font-family:Tahoma;color:blue'><o:p>&nbsp;</o:p></span></font></p>=


<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3DTahoma><span =
style=3D'font-size:
10.0pt;font-family:Tahoma;color:blue'>Did you get this working?&nbsp; =
Regarding
Eclipse the &#8220;irregularities&#8221; in the Javadoc wizard&#8217;s =
memory:
you may be noticing that it saves the command per-project and not
per-workspace.&nbsp; We could consider changing the command path =
automatically
when a project has the AspectJ Nature, but that would involve knowing =
where
your AspectJ install is or shipping a platform-dependent script with the
plugin.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3DTahoma><span =
style=3D'font-size:
10.0pt;font-family:Tahoma;color:blue'><o:p>&nbsp;</o:p></span></font></p>=


<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3DTahoma><span =
style=3D'font-size:
10.0pt;font-family:Tahoma;color:blue'>Mik <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3DTahoma><span =
style=3D'font-size:
10.0pt;font-family:Tahoma;color:blue'><o:p>&nbsp;</o:p></span></font></p>=


<div style=3D'border:none;border-left:solid blue 1.5pt;padding:0in 0in =
0in 4.0pt'>

<div>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font =
size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>
aspectj-users-admin@xxxxxxxxxxx [mailto:aspectj-users-admin@xxxxxxxxxxx] =
<b><span
style=3D'font-weight:bold'>On Behalf Of </span></b><st2:PersonName =
w:st=3D"on"><st1:GivenName
 w:st=3D"on">Russell</st1:GivenName> <st1:Sn =
w:st=3D"on">Miles</st1:Sn></st2:PersonName><br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> <st2:date =
Year=3D"13" Day=3D"13"
Month=3D"5" ls=3D"trans" w:st=3D"on">Thursday, <st2:date Year=3D"13" =
Day=3D"13" Month=3D"5"
 ls=3D"trans" w:st=3D"on">May 13, 2004</st2:date></st2:date> <st2:time =
Minute=3D"43"
Hour=3D"10" w:st=3D"on">10:43 AM</st2:time><br>
<b><span style=3D'font-weight:bold'>To:</span></b> <st2:PersonName =
w:st=3D"on">aspectj-users@xxxxxxxxxxx</st2:PersonName><br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> Re: =
[aspectj-users] ajdoc
in Eclipse 3 M8 (AJDT 1.1.8) No packages or classes =
specified</span></font><o:p></o:p></p>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>Hi =
<st1:GivenName w:st=3D"on">George</st1:GivenName>,<br>
<br>
hmmm, no dice I'm afraid. Also there seems to be irregularities with the
Javadoc wizard not remembering the right tool that you selected. I =
checked out
the ajdoc command script file and it was already set to the % that you
mentioned. I'm totally foxed by this. Luckily I do have a laptop that is
effectively a clean system so maybe it's something to do with my setup =
and a
clean install might help. I'll try that next...<br>
<br>
Cheers,<br>
<br>
<st1:GivenName w:st=3D"on">Russ</st1:GivenName><br>
<br>
On 13 May 2004, at 09:47, George Harley1 =
wrote:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<?smaller>Hi <st1:GivenName w:st=3D"on">Russ</st1:GivenName>,<?/smaller> =
<br>
<br>
<?smaller>Sounds like we need some more information about how you are =
using the
ajdoc.bat script. How many packages are we talking about here ? Are you =
passing
in any other options through the &quot;Extra Javadoc options&quot; panel =
?<?/smaller>
<br>
<br>
<?smaller>Recently it was noticed that the ajdoc.bat launch script on =
Windows
XP was limiting the number of arguments getting passed into the ajdoc =
main
class. If you are running on XP then as a quick check to see if this is =
the
cause of your problem you could go into the ajdoc.bat script and make a =
minor
alteration to the last line. Replace the =
&quot;</span></font><tt><?fontfamily><?param Courier New><font
size=3D2 face=3D"Courier New"><span style=3D'font-size:10.0pt'>%1 %2 %3 =
%4 %5 %6 %7
%8 %9&quot; </span></font><?/fontfamily></tt>with &quot;%*&quot; (no =
quotes
around it). <br>
<?/smaller><br>
<?smaller>Best regards,<?/smaller> <br>
<st1:GivenName w:st=3D"on"><?smaller>George</st1:GivenName><br>
<?/smaller><?smaller>________________________________________<br>
<?/smaller><st2:PersonName w:st=3D"on"><st1:GivenName =
w:st=3D"on"><?smaller>George</st1:GivenName>
 <st1:middlename w:st=3D"on">C.</st1:middlename> <st1:Sn =
w:st=3D"on">Harley</st1:Sn></st2:PersonName><br>
<?/smaller><br>
<br>
<br>
<br>
<br>
<br>
<st2:PersonName w:st=3D"on"><st1:GivenName =
w:st=3D"on"><b><?smaller><?x-tad-smaller><span
  style=3D'font-weight:bold'>Russell</span></b></st1:GivenName><b><span
 style=3D'font-weight:bold'> <st1:Sn =
w:st=3D"on">Miles</st1:Sn></span></b></st2:PersonName><b><span
style=3D'font-weight:bold'> =
&lt;russellmiles@xxxxxxx&gt;</span><?/x-tad-smaller><?/smaller></b><?smal=
ler><?x-tad-smaller>
<o:p></o:p></p>

<?/x-tad-smaller><?/smaller>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<?smaller><?x-tad-smaller>Sent by: =
aspectj-users-admin@xxxxxxxxxxx<o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<br>
<st2:date Year=3D"2004" Day=3D"05" Month=3D"12" ls=3D"trans" =
w:st=3D"on"><?smaller><?x-tad-smaller>12/05/2004</st2:date>
22:34<o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<br>
<?smaller><?x-tad-smaller>Please respond to<o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<?smaller><?x-tad-smaller>aspectj-users<o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<br>
<br>
<br>
<?smaller><?x-tad-smaller>To<o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<st2:PersonName =
w:st=3D"on"><?smaller><?x-tad-smaller>aspectj-users@xxxxxxxxxxx</st2:Pers=
onName><o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<br>
<?smaller><?x-tad-smaller>cc<o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<br>
<?smaller><?x-tad-smaller>Subject<o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><br>
<?smaller><?x-tad-smaller>[aspectj-users] ajdoc in Eclipse 3 M8 (AJDT =
1.1.8) No
packages or classes specified<o:p></o:p></span></font></p>

<?/x-tad-smaller><?/smaller></blockquote>

<blockquote style=3D'margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><font size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</span></font><tt><?x-tad-smaller><font size=3D2 face=3D"Courier =
New"><span
style=3D'font-size:10.0pt'>Hi =
everyone,</span></font><?/x-tad-smaller></tt><br>
<br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>This one has been bugging me for a while now and for the life of =
me I </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>can't seem to figure out what is wrong. I am using Eclipse 3 M8, =
AJDT </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>1.1.8 with AspectJ 1.2 on the machine. i am trying to generate =
the docs
</span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>using AJDoc which was working fine up until I put my source on a =
CVS </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>server and now I am getting the message 'No packages or classes =
</span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>specified' every time I try to run the documentation generation. =
I am </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>also getting the 'Ignoring unsupported option: -use' message, is =
that </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>anything to do with it? I think I got that message before and =
the </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>source still generated ok. I've tried this out on my Mac and =
Windows </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>boxes (same environment setup) and still no =
joy.</span></font><?/x-tad-smaller></tt><br>
<br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>I've checked the documentation creation wizard and everything =
seems to </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>be in order (all my sources seem selected), and things were =
working ok </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>before. Basically has anyone else had this problem? It just =
stinks of </span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>being something silly I've done but any help in putting me right =
would</span></font><?/x-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>be great.</span></font><?/x-tad-smaller></tt><br>
<br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>Cheers,</span></font><?/x-tad-smaller></tt><br>
<br>
<st1:GivenName w:st=3D"on"><tt><?x-tad-smaller><font size=3D2 =
face=3D"Courier New"><span
 =
style=3D'font-size:10.0pt'>Russ</span></font><?/x-tad-smaller></tt></st1:=
GivenName><br>
<br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>_______________________________________________</span></font><?/x=
-tad-smaller></tt><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>aspectj-users mailing =
list</span></font><?/x-tad-smaller></tt><br>
<st2:PersonName w:st=3D"on"><tt><?x-tad-smaller><font size=3D2 =
face=3D"Courier New"><span
 =
style=3D'font-size:10.0pt'>aspectj-users@xxxxxxxxxxx</span></font><?/x-ta=
d-smaller></tt></st2:PersonName><br>
<tt><?x-tad-smaller><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:
10.0pt'>http://dev.eclipse.org/mailman/listinfo/aspectj-users</span></fon=
t><?/x-tad-smaller></tt><o:p></o:p></p>

</blockquote>

</div>

</div>

</body>

</html>

------=_NextPart_000_0036_01C4426B.90454850--


--__--__--

Message: 2
From: "Pavel Kusch" <pavel@xxxxxxxxxxxxxx>
To: <aspectj-users@xxxxxxxxxxx>
Date: Mon, 29 Mar 2004 13:54:12 -0600
Subject: [aspectj-users] Per-control-flow aspect question
Reply-To: aspectj-users@xxxxxxxxxxx

This is a multi-part message in MIME format.

------=_NextPart_000_009E_01C41595.50AA3960
Content-Type: text/plain;
             charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

I have been using AspectJ for 3 days now and it is great. I would like =
to introduce it to our project immediatelly. Please could anybody verify =
my design since I am new to this cool stuff.

I would like to use AspectJ for managing logging, exception handling, =
singletons and .....

We are developing middleware application that gets correlation id from =
client for logging. We need different instance of the logger for each =
transaction. Entry point for the application is a stateless session bean =
that delegates to POJO Facade (singleton). I thought to use =
Per-control-flow aspect which would be instantiated when any of the =
Facade methods are called. Then there would be one aspect holding the =
logger per thread available for the whole execution. Each concurrent =
transaction executing in different thread would have its own logger. =
Please see below the aspect code.

Questions:
1) Are my assumtions about Per-control-flow aspect correct? Or should it =
be done in different way?
2) Do I need to specify cflow() in the facadeExceptions() pointcut?
=20
Thank you,

Pavel

******************************************** ASPECT =
*****************************************************************
package aspekty;

import org.aspectj.lang.*;

public aspect LoggerAspect percflow (expCall()){
 Logger logger;
=20
 pointcut expCall() : target(Facade) &&
                      (call(public void executeFirst(int))  ||
                       call(public void executeSecond(int)) ||
                       call(public void executeThird(int)));
=20
 before (int par): expCall() && args(par){
     Container container =3D new Container();
     LoggerFactory factory =3D container.getLoggerFactory();
     logger =3D factory.getLogger(par);
 }
=20
//Log exception and let it go to ExceptionHandlerAspect to process
 pointcut facadeExceptions(): call(public void Facade.*(..)) ||
                              call(private void =
ServiceAccess.disconnect());
               =20
 after() throwing(Throwable ex): facadeExceptions() {
     logger.log(ex);
 }
=20

//Log entry to facade methods
    pointcut facadeEntry(Facade facade): target(facade) &&
                                         execution (public void *(..));
   =20
    before(Facade facade): facadeEntry(facade) {
  Signature sig =3D thisJoinPointStaticPart.getSignature();
  String context =3D "[" + sig.getDeclaringType().getName() + "." + =
sig.getName() + "]";
  logger.logEntry(context);
    }
}

------=_NextPart_000_009E_01C41595.50AA3960
Content-Type: text/html;
             charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have been using AspectJ for&nbsp;3 =
days now and=20
it is great. I would like to introduce it to our project immediatelly. =
Please=20
could anybody verify my design since I am new to this cool =
stuff.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I would like to use AspectJ for =
managing logging,=20
exception handling, singletons and .....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>We are developing middleware =
application that gets=20
correlation id from client for logging. We need different instance of =
the logger=20
for each transaction. Entry point for the application is a stateless =
session=20
bean that delegates to POJO Facade (singleton). I thought to use=20
Per-control-flow aspect which would be instantiated when any of the =
Facade=20
methods are called. Then there would be one aspect holding the =
logger&nbsp;per=20
thread available for the whole execution. Each concurrent transaction =
executing=20
in different thread would have its own logger.&nbsp;Please see below the =
aspect=20
code.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Questions:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>1) Are my assumtions about =
Per-control-flow aspect=20
correct? Or should it be done in different way?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2) Do I need to specify cflow() in the=20
facadeExceptions() pointcut?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thank you,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Pavel</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>******************************************** ASPECT=20
*****************************************************************</FONT><=
/DIV>
<DIV><FONT face=3DArial size=3D2>package aspekty;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>import org.aspectj.lang.*;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>public aspect LoggerAspect percflow=20
(expCall()){<BR>&nbsp;Logger logger;<BR>&nbsp;<BR>&nbsp;pointcut =
expCall() :=20
target(Facade)=20
&amp;&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
(call(public void executeFirst(int))&nbsp;=20
||<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
call(public void executeSecond(int))=20
||<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
call(public void executeThird(int)));<BR>&nbsp;<BR>&nbsp;before (int =
par):=20
expCall() &amp;&amp; args(par){<BR>&nbsp;&nbsp;&nbsp;&nbsp; Container =
container=20
=3D new Container();<BR>&nbsp;&nbsp;&nbsp;&nbsp; LoggerFactory factory =
=3D=20
container.getLoggerFactory();<BR>&nbsp;&nbsp;&nbsp;&nbsp; logger =3D=20
factory.getLogger(par);<BR>&nbsp;}<BR>&nbsp;<BR>//Log exception and let =
it go to=20
ExceptionHandlerAspect to process<BR>&nbsp;pointcut facadeExceptions():=20
call(public void Facade.*(..))=20
||<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
call(private void=20
ServiceAccess.disconnect());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;after() =
throwing(Throwable=20
ex): facadeExceptions() {<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
logger.log(ex);<BR>&nbsp;}<BR>&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//Log entry to facade =
methods<BR>&nbsp;&nbsp;&nbsp;=20
pointcut facadeEntry(Facade facade): target(facade)=20
&amp;&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
execution (public void *(..));<BR>&nbsp;&nbsp;&nbsp; =
<BR>&nbsp;&nbsp;&nbsp;=20
before(Facade facade): facadeEntry(facade) {<BR>&nbsp;&nbsp;Signature =
sig =3D=20
thisJoinPointStaticPart.getSignature();<BR>&nbsp;&nbsp;String context =
=3D "[" +=20
sig.getDeclaringType().getName() + "." + sig.getName() +=20
"]";<BR>&nbsp;&nbsp;logger.logEntry(context);<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_009E_01C41595.50AA3960--


--__--__--

Message: 3
From: "jan casteels" <jan_casteels@xxxxxxx>
To: aspectj-users@xxxxxxxxxxx
Date: Wed, 26 May 2004 03:50:36 +0200
Subject: [aspectj-users] AspectJ in large scale development projects.
Reply-To: aspectj-users@xxxxxxxxxxx

Hi All,

What is the experience of the people on the list of running AspectJ in a
large scale development project with 9000+ java files?

What are the different setups of the project in ant to have acceptable
compile times

What are the different possible setups in Eclipse?

I tried to compile our project with the ajc compiler but after 45 minutes
still no result (seems to be pending)


Jan

_________________________________________________________________
Plannen om een nieuwe computer te kopen? Kijk eens hier...
http://www.msn.be/shopping/dell_bis/



--__--__--

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


End of aspectj-users Digest





Back to the top