|
Re: using AspectJ in plugin development ? [message #3466 is a reply to message #3331] |
Thu, 12 September 2002 09:26 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03042 seconds