Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » using AspectJ in plugin development ?
using AspectJ in plugin development ? [message #3331] Wed, 11 September 2002 15:58 Go to next message
Konstantin Dorodov is currently offline Konstantin DorodovFriend
Messages: 9
Registered: July 2009
Junior Member
Hi!

Is there anybody using aspectj for eclipse plugin development?

How complicate it would be to write an aspect which intercepts,
say call to an interface X in JDT plugin?

Would it be possible to have one aspect intercepting calls
to classes residing in several plugins?

Kostja
Re: using AspectJ in plugin development ? [message #3466 is a reply to message #3331] Thu, 12 September 2002 09:26 Go to previous message
Eclipse UserFriend
Originally posted by: amode.arrakis.es

As far as I know nobody is using aspectj for plugin development. But I think
it is easy to write aspects working like you want. All you have to do is
define the point cuts in a correct way. Something like this may work (I
havn't tested it):

pointcut calltoX(): call(* X.*(..)); // Execution of any method (not
constructors) of X

To catch all the method calls in subpackages of org.eclipse
pointcut calltoPlugin(): call(* org.eclipse..*(..));
Perhaps if all your plugins ends with Plugin under the package com.myplugs:
pointcut calltoPlugin(): call(* com.myplugs..*Plugin.*(..));
You can mix:
pointcut calltoPlugin(): call(* com.myplugs..*Plugin.*(..)) || call(*
org.eclipse..*(..));

So as you can see the only difficulty is knowing the patterns for naming the
plugin, but you can always compose differents rules if the name of the
plugins are not homogeneous.

Of course, you must have access to the source code of the plugins and
recompile them with the aspect.

KiKe.

"Kostja Dorodov" <dorodovkostja@inbox.lv> escribi
Re: using AspectJ in plugin development ? [message #561267 is a reply to message #3331] Thu, 12 September 2002 09:26 Go to previous message
Eclipse UserFriend
Originally posted by: amode.arrakis.es

As far as I know nobody is using aspectj for plugin development. But I think
it is easy to write aspects working like you want. All you have to do is
define the point cuts in a correct way. Something like this may work (I
havn't tested it):

pointcut calltoX(): call(* X.*(..)); // Execution of any method (not
constructors) of X

To catch all the method calls in subpackages of org.eclipse
pointcut calltoPlugin(): call(* org.eclipse..*(..));
Perhaps if all your plugins ends with Plugin under the package com.myplugs:
pointcut calltoPlugin(): call(* com.myplugs..*Plugin.*(..));
You can mix:
pointcut calltoPlugin(): call(* com.myplugs..*Plugin.*(..)) || call(*
org.eclipse..*(..));

So as you can see the only difficulty is knowing the patterns for naming the
plugin, but you can always compose differents rules if the name of the
plugins are not homogeneous.

Of course, you must have access to the source code of the plugins and
recompile them with the aspect.

KiKe.

"Kostja Dorodov" <dorodovkostja@inbox.lv> escribi
Previous Topic:org.eclipse.core.runtime 0 java.lang.NullPointerExceptio
Next Topic:class-files
Goto Forum:
  


Current Time: Thu Apr 25 14:22:53 GMT 2024

Powered by FUDForum. Page generated in 0.03042 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top