Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] weaving into Eclipse classes

Hi Davi,

So if I understand things correctly, you would like to weave
additional methods from your plugin into classes in the
org.eclipse.jdt.core project.

I know of a way that might work for you.  You could use the ajc
compiler (either via the command line or from one of the ajc ant
tasks) with the inpath, outjar, and classpath options.  However, I
have tried to weave into the org.eclipse.jdt.core project before, and
I received a code size too big error (see
http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg06484.html for
more information).  So to get around that, you would need to do some
refactoring of that project - you would have to break up the classes
that produced the code size too big error.  Also if your methods make
use of some type that cannot be resolved based on the project's
manifest file, you may need to update that file.

Of course the easiest way to achieve your goal would be to check out
the org.eclipse.jdt.core project from the eclipse cvs repository, make
your additions by editing the code, build the project, and then deploy
the plugin.  But I suppose this might not work for you, depending on
what your methods are.

As far as I can understand, Mahler (in
http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg06414.html )
wanted to weave advice into classes defined in his own plugin, which
seems like a different situation than yours.

Arjun

On 10/9/06, Davi Pires <inhodpr@xxxxxxxxx> wrote:
Arjun,

 Thanks. I'll take a look at AJEER and see if it helps.

 However, from those threads I read, it seems to be possible to weave into
other plugins without using any special technology. And that would be the
best choice, undoubtedly, but I can't figure out how it can be done.

 Perhaps Mr. Mahler himself could show me the way...

 Thanks for the help.

 Davi Pires




On 10/6/06, Arjun Singh <aasingh@xxxxxxxxx> wrote:
> Each plugin has its own classloader.  According the the aspectj
> developer guide, load time weaving is done in the context of a class
> loader.  A class loader can only weave classes that it defines, not
> classes loaded by other class loaders.  So I believe that is why an
> aspect in your plugin is not woven into any of the eclipse plugins.
> AJEER defines specialized classloaders that somehow address this.
>
> Hope that helps,
> Arjun
>
> On 10/6/06, Davi Pires < inhodpr@xxxxxxxxx> wrote:
> > Not really, actually.
> >
> > In the second thread, Mahler says:
> > > I now know that one cannot apply aspects within Eclipse code
> > > without using something like AJEER (or AOSGI when it becomes
available).
> > >
> >
> > And that's precisely what I don't know.
> >
> >
> >
> >
> >  On 10/6/06, Arjun Singh <aasingh@xxxxxxxxx> wrote:
> > > Hi Davi,
> > >
> > > There are two related threads that might help you:
> > >
> > >
> >
http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg06409.html
> > >
> >
http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg06414.html
> > >
> > > After reading those, do you have any questions?
> > >
> > > Arjun
> > >
> > > On 10/6/06, Davi Pires < inhodpr@xxxxxxxxx> wrote:
> > > > Hi all,
> > > >
> > > > I'm writing an Eclipse plugin that tries to use AspectJ to weave
some
> > > > methods into the classes of Eclipse AST, which are in the package
> > > > org.eclipse.jdt.core.dom.
> > > >
> > > > However, I don't understand the warning I get from the compiler,
saying
> > that
> > > > "the type is not exposed to the weaver". I have the plugins in the
> > > > dependencies list of my plugin, and I thought the load time weaver
could
> > > >
> > > > Anyone can show me a way to get around this (if there is any)?
> > > >
> > > > Thanks.
> > > >
> > > > Davi Pires
> > > >
> > > > _______________________________________________
> > > > aspectj-users mailing list
> > > > aspectj-users@xxxxxxxxxxx
> > > >
https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > > >
> > > >
> > > >
> > > _______________________________________________
> > > aspectj-users mailing list
> > > aspectj-users@xxxxxxxxxxx
> > >
https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > >
> >
> >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> >
> >
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


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





Back to the top