RE: [aspectwerkz-user] Applying aspects to Eclipse

"Benjamin Livshits" <[email protected]> Wed, 22 Jun 2005 02:13:01 -0700
Newsgroups gmane.comp.java.aspectwerkz.user
Organization Stanford University
Message-ID <[email protected]>
I used the tracing options and the system is only detecting matches in the
beginning during startup. My command line looks as follows:

java -mx1024m -cp
.:./startup.jar:/u/livshits/work/src/aspectwerkz-2.0/lib/aspectwerkz-core-2.
0.jar:/u/livshits/work/src/aspectwerkz-2.0/lib/aspectwerkz-2.0.jar:/u/livshi
ts/work/src/aspectwerkz-2.0/lib/trove-1.0.2.jar:/u/livshits/work/src/aspectw
erkz-2.0/lib/jrexx-1.1.1.jar:/u/livshits/work/src/aspectwerkz-2.0/lib/dom4j-
1.4.jar -Daspectwerkz.transform.verbose=false
-Daspectwerkz.transform.details=true
-javaagent:/u/livshits/work/src/aspectwerkz-2.0/lib/aspectwerkz-jdk5-2.0.jar
org.eclipse.core.launcher.Main -install /home/livshits/mining/eclipse -os
linux -ws gtk -arch x86 -nosplash -consolelog

and aop.xml looks like this:

<aspectwerkz>
<system id="id/id">
<package name="examples">
            <aspect class="test" deployment-model="perJVM">
                <pointcut name="caller" expression="call(* addListener(..))
|| call(* getProperty(..)) || call(* removeListener(..)) || call(* size()$
                <advice name="print" type="before" bind-to="caller"/>
            </aspect>
</package>
</system>
</aspectwerkz> 

The advice just prints joint point information. BTW, how does one retrieve
the caller and argument info from a pointcut?

I don't really know what else to try. Which version of Eclipse was reported
to work with this approach?..

Thanks much.
-Ben

> -----Original Message-----
> From: Alexandre Vasseur [mailto:[email protected]] 
> Sent: Wednesday, June 22, 2005 12:46 AM
> To: [email protected]
> Subject: Re: [aspectwerkz-user] Applying aspects to Eclipse
> 
> Hi
> 
> Our load time weaving does intercept any classloader, and it 
> has been reported to work fine with OSGi bundles that Eclipse 
> is using.
> May be the "verbose" options from the FAQ will help to have 
> some information.
> 
> from FAQ:
>  What are the common steps to perform when I have some troubles?
>     The following options and process are common answers to problems:
> 
>         * use -Daspectwerkz.transform.verbose=true (or 
> -verbose with offline mode command line tool and Ant task) to 
> turn on the verbose mode that will tell more when classes 
> gets presented to the weaver.
>         * use -Daspectwerkz.transform.details=true (or 
> -details with offline mode command line tool and Ant task) to 
> turn on pointcut matching verbose mode that will tell more 
> when pointcuts match. This is usefull to understand why 
> "nothing happen !" or why "the application is very low to 
> start up!" (due to a pointcut matching almost every single 
> instruction f.e.). The output will print message about 
> "earlymatch" and "match". An early match means that there 
> might be a match but that further analysis of the class 
> beeing weaved is needed. A match thus means a pointcut match 
> (thus an actual join point). When a mixin is used, you only 
> see early matches.
> 
> Alex
> 
> On 6/21/05, Benjamin Livshits <[email protected]> wrote:
> > I am trying to use load-time weaving with Java 5 agent support to 
> > apply aspects to Eclipse. Things appear to go okay while the main 
> > class loader is active, however, soon thereafter, Eclipse 
> spawns a new 
> > class loader. It seems from then on pointcuts don't hit anymore.
> > 
> > Has anybody tried something like this? IS there a way to 
> get around this?
> > 
> > Thanks much in advance.
> > 
> > -Ben
> > 
> >
>