[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] New to Aspect J!!!

Hi All,

I'm quite new to Aspect J. I wrote a logger that can
print the log message at the beginning and end of any
method and i tested it using a test class. It works
fine.  Now i want this to be added to my project for
all the classes whenever required.

Let's say for the test purposes i use the package

I've the following  files in that package


I also have a files called files.lst which has the
following entries


In this case, it works fine with me.

If i want to add this aspect to all the classes in my
project, should i have to provide a files.lst in each
of the package folders and one main files.lst with
references to all these sub folders????  Do i need to
add each and every file that needs to be intercepted
in this files.lst in each and every package?

The problem is that i've source code in multiple
folders (shared folder which has source code shared by
multiple projects etc).  If i add the following lines:

  <src path="${src.dir}"/>
                    <src path="${sharedsrc.dir}"/>
                    <src path="${gensrc.dir}"/>       
in the "iajc" task as follows, i get that Trace
"already defined error" as it's found in the src.dir
and also in files.lst.  Should i keep the aspects in a
difference package hierarchy??? What's the best way to
enable AOP using my Trace aspect for all my classes.

<target name="Ajx" depends="init">
                <echo message="list of files are:
                <iajc destdir="${build.dir}/classes"
fork="true" forkclasspath="${aspectjtools.jar}"
                    <src path="${src.dir}"/>
                    <src path="${sharedsrc.dir}"/>
                    <src path="${gensrc.dir}"/>       
                 <antcall target="Ajx-run" >
                         <param name="class"

Thanks in advance,

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around