Re: aspectj-dev Digest, Vol 4, Issue 5

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: aspectj-dev Digest, Vol 4, Issue 5

Mike Haladin
Hi Alex,

        I am looking to weave existing applications in my project.  There are
100s of jars and they all depend upon each other.  The dependencies are
contained within the Class-Path attribute of the manifest of each jar.  

I do not want to recurse through all the jars in the manifest of the
application I am starting.  I would like to just specify the application
jar in the aj.class.path and have the weaver find the jars I need from
the manifest class-paths.  This is how the default classloader works I
believe.

Right now I am required to know every single jar that is required and
specify it with aj.class.path.

example:

aj.jar's Class-Path= ../mike.jar /opt/task.jar
mike.jar's Class-Path=/opt/james.jar
task.jar's Class-Path=
james.jar's Class-Path=

currently aj.class.path would need be:
aj.jar:../mike.jar:/opt/task.jar:../james.jar

I would like:

aj.class.path=aj.jar

or at least

aj.class.path= aj.jar:../mike.jar:/opt/task.jar

I would like this for 1.4 if possible as I do not know when we will move
to 1.5.

then we would just supply the original list to the weavingURLCLassloader
and it will weave the jars it needs as well.

thanks,
Mike


> Date: Fri, 10 Jun 2005 09:38:06 +0200
> From: Alexandre Vasseur <[hidden email]>
> Subject: Re: [aspectj-dev] WeavingURLClassLoader does not follow jar
> Class-Paths
> To: Wes Isberg <[hidden email]>, AspectJ developer discussions
> <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Mike,
>
> Could you describe some more your use case. We could see if it will be
> adressed thru the load time weaving things that will surface in M3
> (based on -javaagent for Java 5 - tell us if you would like it on 1.3
> / 1.4 ).
> Perhaps the load time weaving (that will require at least a JVM
> option) will be too much for what you are trying to do ?
>
> Alex
>
> On 6/10/05, Wes Isberg <[hidden email]> wrote:
> > Hi -
> >
> > Sorry, this looks like another area where WeavingClassLoader
> > is more demonstration- than production-quality.  If someone
> > wants to make this work, we'd welcome a patch via an enhancement
> > request.
> >
> > Thanks for pointing this out.
> > Wes
> >
> > > ------------Original Message------------
> > > From: Mike Haladin <[hidden email]>
> > > To: [hidden email]
> > > Date: Tue, Jun-7-2005 7:51 AM
> > > Subject: [aspectj-dev] WeavingURLClassLoader does not follow jar Class-Paths
> > >
> > > Hello,
> > >
> > >       I am attempting to replace my project's customized URLClassLoader with
> > > the WeavingURLClassLoader.  However I find this difficult as it appears
> > > that WeavingURLClassLoader does not follow the class-path in the
> > > manifest of the provided jar files.
> > >
> > > Do I need to give it a full list of all jar files needed to the
> > > WeavingURLClassLoader? (In my code below this would be libs)
> > >
> > > or is there a way to force WeavingURLClassLoader to also weave and load
> > > the jars in the manifest Class-Path of the jars passed to it in
> > > variable
> > > libs?
> > >
> > >
> > > pointcut classloaderurl(URL[] libs, ClassLoader parent): call
> > > (URLClassLoader.new(..)) && args(libs, parent) && !this(classweaver);
> > >
> > >  URLClassLoader around (URL[] libs, ClassLoader parent) :
> > > classloaderurl(libs,parent)
> > >     {
> > >       URL[] aspectURLs;
> > >
> > >         URL url = null;
> > >
> > >         List urlList = new ArrayList();
> > >
> > >         try
> > >         {
> > >
> > >               url = makeURL("myaspect.jar");
> > >
> > >               if (url != null) urlList.add(url);
> > >
> > >         }
> > >         catch(URISyntaxException e)
> > >         {
> > >
> > >         }
> > >
> > > //      Add the Aspect URLs
> > >
> > >         aspectURLs = new URL[urlList.size()];
> > >
> > >       return(new WeavingURLClassLoader (libs, aspectURLs, parent));
> > >
> > >     }
> > >
> > > thanks,
> > > Mike Haladin
> > >
> > > --
> > >
> > > _______________________________________________
> > > aspectj-dev mailing list
> > > [hidden email]
> > > https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> > >
> >
> > _______________________________________________
> > aspectj-dev mailing list
> > [hidden email]
> > https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> >
>
>
> ------------------------------
>
> _______________________________________________
> aspectj-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
>
> End of aspectj-dev Digest, Vol 4, Issue 5
> *****************************************
--
_______________________________________________
aspectj-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/aspectj-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: aspectj-dev Digest, Vol 4, Issue 5

Alexandre Vasseur
Mike

I do get this classpath / manifest classpath issue.
My claim is that this is tied to the WeavingURLClassLoader, but not to
the upcoming more generic load time weaving support.

Would use of a JVM option to turn on weaving on a JVM wide basis would
be ok - thus not using the WeavingURLClassLoader ?

Alex

On 6/16/05, Mike Haladin <[hidden email]> wrote:

> Hi Alex,
>
>         I am looking to weave existing applications in my project.  There are
> 100s of jars and they all depend upon each other.  The dependencies are
> contained within the Class-Path attribute of the manifest of each jar.
>
> I do not want to recurse through all the jars in the manifest of the
> application I am starting.  I would like to just specify the application
> jar in the aj.class.path and have the weaver find the jars I need from
> the manifest class-paths.  This is how the default classloader works I
> believe.
>
> Right now I am required to know every single jar that is required and
> specify it with aj.class.path.
>
> example:
>
> aj.jar's Class-Path= ../mike.jar /opt/task.jar
> mike.jar's Class-Path=/opt/james.jar
> task.jar's Class-Path=
> james.jar's Class-Path=
>
> currently aj.class.path would need be:
> aj.jar:../mike.jar:/opt/task.jar:../james.jar
>
> I would like:
>
> aj.class.path=aj.jar
>
> or at least
>
> aj.class.path= aj.jar:../mike.jar:/opt/task.jar
>
> I would like this for 1.4 if possible as I do not know when we will move
> to 1.5.
>
> then we would just supply the original list to the weavingURLCLassloader
> and it will weave the jars it needs as well.
>
> thanks,
> Mike
>
>
> > Date: Fri, 10 Jun 2005 09:38:06 +0200
> > From: Alexandre Vasseur <[hidden email]>
> > Subject: Re: [aspectj-dev] WeavingURLClassLoader does not follow jar
> >       Class-Paths
> > To: Wes Isberg <[hidden email]>,  AspectJ developer discussions
> >       <[hidden email]>
> > Message-ID: <[hidden email]>
> > Content-Type: text/plain; charset=ISO-8859-1
> >
> > Mike,
> >
> > Could you describe some more your use case. We could see if it will be
> > adressed thru the load time weaving things that will surface in M3
> > (based on -javaagent for Java 5 - tell us if you would like it on 1.3
> > / 1.4 ).
> > Perhaps the load time weaving (that will require at least a JVM
> > option) will be too much for what you are trying to do ?
> >
> > Alex
> >
> > On 6/10/05, Wes Isberg <[hidden email]> wrote:
> > > Hi -
> > >
> > > Sorry, this looks like another area where WeavingClassLoader
> > > is more demonstration- than production-quality.  If someone
> > > wants to make this work, we'd welcome a patch via an enhancement
> > > request.
> > >
> > > Thanks for pointing this out.
> > > Wes
> > >
> > > > ------------Original Message------------
> > > > From: Mike Haladin <[hidden email]>
> > > > To: [hidden email]
> > > > Date: Tue, Jun-7-2005 7:51 AM
> > > > Subject: [aspectj-dev] WeavingURLClassLoader does not follow jar Class-Paths
> > > >
> > > > Hello,
> > > >
> > > >       I am attempting to replace my project's customized URLClassLoader with
> > > > the WeavingURLClassLoader.  However I find this difficult as it appears
> > > > that WeavingURLClassLoader does not follow the class-path in the
> > > > manifest of the provided jar files.
> > > >
> > > > Do I need to give it a full list of all jar files needed to the
> > > > WeavingURLClassLoader? (In my code below this would be libs)
> > > >
> > > > or is there a way to force WeavingURLClassLoader to also weave and load
> > > > the jars in the manifest Class-Path of the jars passed to it in
> > > > variable
> > > > libs?
> > > >
> > > >
> > > > pointcut classloaderurl(URL[] libs, ClassLoader parent): call
> > > > (URLClassLoader.new(..)) && args(libs, parent) && !this(classweaver);
> > > >
> > > >  URLClassLoader around (URL[] libs, ClassLoader parent) :
> > > > classloaderurl(libs,parent)
> > > >     {
> > > >       URL[] aspectURLs;
> > > >
> > > >         URL url = null;
> > > >
> > > >         List urlList = new ArrayList();
> > > >
> > > >         try
> > > >         {
> > > >
> > > >               url = makeURL("myaspect.jar");
> > > >
> > > >               if (url != null) urlList.add(url);
> > > >
> > > >         }
> > > >         catch(URISyntaxException e)
> > > >         {
> > > >
> > > >         }
> > > >
> > > > //      Add the Aspect URLs
> > > >
> > > >         aspectURLs = new URL[urlList.size()];
> > > >
> > > >       return(new WeavingURLClassLoader (libs, aspectURLs, parent));
> > > >
> > > >     }
> > > >
> > > > thanks,
> > > > Mike Haladin
> > > >
> > > > --
> > > >
> > > > _______________________________________________
> > > > aspectj-dev mailing list
> > > > [hidden email]
> > > > https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> > > >
> > >
> > > _______________________________________________
> > > aspectj-dev mailing list
> > > [hidden email]
> > > https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> > >
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > aspectj-dev mailing list
> > [hidden email]
> > https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> >
> >
> > End of aspectj-dev Digest, Vol 4, Issue 5
> > *****************************************
> --
> _______________________________________________
> aspectj-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
_______________________________________________
aspectj-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/aspectj-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Compiler and IDE feedback

Christoph Bockisch
Hi,

I have a question regarding the coupling between the feedback presented
by the AJDT and the AspectJ compiler.

As far as I understand it, the standard AspectJ compiler, which can also
be used from the command line, is used by the AJDT. This compiler
generates the mapping between join point shadows and aspects on the fly.
But only when the compilation is triggered within the AJDT. If the
compilation is startet from the command line, no such mapping is generated.

Is this description correct? It may be that my understandings are not up
to date. In this case I would much appreciate a short description of how
and when the relevant data for IDE feedback is gathered.

Many thanks in advance,
Christoph

--
Dipl.-Inform. Christoph Bockisch    [hidden email]
Software Technology Group           Phone:  ++49 (0) 6151-16-3608
Darmstadt University of Technology  Fax:    ++49 (0) 6151-16-5410
Hochschulstr. 10, 64289 Darmstadt, Germany
http://www.st.informatik.tu-darmstadt.de/
_______________________________________________
aspectj-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/aspectj-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compiler and IDE feedback

Andrew Clement




Information about which advice has been applied at which join points is
returned to the IDE in a 'structure model' - AJDT sets a switch in the
compiler just before performing a build indicating that the compiler should
create a structure model.  The model is in two parts, a tree structure of
the elements in your project (so projects contain packages contain types
contain methods) and then a relationships map that specifies two nodes in
the structure and the relationship between them (method X is advised by
before advice from aspect Y).  A correct structure model is available to
AJDT when the compiler indicates it has finished.

When operating on the command line we provide the '-showWeaveInfo' option
which informs you about what was woven where - effectively it dumps the
relationships to standard out that would have gone into the relationships
map.

It isn't too difficult to bootstrap the compiler such that you can get it
to build you a structure model outside of AJDT and then programmatically
access it through the AsmManager class in AspectJ.

Andy.
---
Andy Clement
AspectJ Dev
[hidden email]



                                                                           
             Christoph                                                    
             Bockisch                                                      
             <bockisch@informa                                          To
             tik.tu-darmstadt.         AspectJ developer discussions      
             de>                       <[hidden email]>          
             Sent by:                                                   cc
             aspectj-dev-bounc                                            
             [hidden email]                                        Subject
                                       [aspectj-dev] Compiler and IDE      
                                       feedback                            
             16/06/2005 15:27                                              
                                                                           
                                                                           
             Please respond to                                            
             AspectJ developer                                            
                discussions                                                
             <aspectj-dev@ecli                                            
                 pse.org>                                                  
                                                                           
                                                                           




Hi,

I have a question regarding the coupling between the feedback presented
by the AJDT and the AspectJ compiler.

As far as I understand it, the standard AspectJ compiler, which can also
be used from the command line, is used by the AJDT. This compiler
generates the mapping between join point shadows and aspects on the fly.
But only when the compilation is triggered within the AJDT. If the
compilation is startet from the command line, no such mapping is generated.

Is this description correct? It may be that my understandings are not up
to date. In this case I would much appreciate a short description of how
and when the relevant data for IDE feedback is gathered.

Many thanks in advance,
Christoph

--
Dipl.-Inform. Christoph Bockisch    [hidden email]
Software Technology Group           Phone:  ++49 (0) 6151-16-3608
Darmstadt University of Technology  Fax:    ++49 (0) 6151-16-5410
Hochschulstr. 10, 64289 Darmstadt, Germany
http://www.st.informatik.tu-darmstadt.de/
_______________________________________________
aspectj-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/aspectj-dev


_______________________________________________
aspectj-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/aspectj-dev
Loading...