Equinox Aspects not functioning as documented [message #662805] |
Thu, 31 March 2011 23:13  |
Eclipse User |
|
|
|
I have created an aspect within one bundle whose pointcut keys off a method call by an interface in another bundle.
I have done all that is described in the documentation in order to properly set up the aspect, but apparently the aspect isn't being engaged. In fact, in the code I am getting a warning saying that the advice "has not been applied".
My aspect is:
public aspect ServiceGate
{
pointcut serviceCatch(Map<String,String> theMap) :
cflowbelow(execution(void BundleActivator.start(BundleContext))) &&
execution(ServiceResult IAresService.performService(Map<String,String>)) &&
args(theMap);
ServiceResult around(Map<String,String> theMap) : serviceCatch(theMap)
{
System.out.println("A Service was called!");
return(proceed(theMap));
}
}
The manifest for the aspect bundle is below:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Security Bridge
Bundle-SymbolicName: mil.af.ares.aspect.security
Bundle-Version: 1.0.0
Bundle-Activator: mil.af.ares.aspect.security.SecurityActivator
Bundle-Vendor: Self
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: mil.af.ares.service.intfc,
org.osgi.framework;version="1.3.0"
Bundle-ActivationPolicy: lazy
Require-Bundle: org.aspectj.runtime;bundle-version="1.6.11";visibility:=reexport
Export-Package: mil.af.ares.aspect.bridge
Eclipse-SupplementBundle: mil.af.ares.service.intfc
and my aop.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<aspectj>
<aspects>
<aspect name="mil.af.ares.aspect.bridge.ServiceGate" />
</aspects>
</aspectj>
This setup follows the documentation for using Equinox Aspects exactly, but for some reason the aspect is not working.
Am I missing something in the setup? I have the weaver working and the hook is properly set up (and the debugger shows the hook code working properly!). I have set up everything else according to the documentation, or at least I am sure that I did. So am I missing something,or have I found a bug in Equinox Aspects. Does it work at all?
If I have found a bug, where do I go to report it? Who do I talk to about problems with this project???
Someone please advise.
|
|
|
|
|
|
|
Re: Equinox Aspects not functioning as documented [message #666642 is a reply to message #665799] |
Thu, 21 April 2011 08:16  |
Eclipse User |
|
|
|
Hey Robert!
> The weaver is apparently starting first (I had to play with some start
> levels to cause this) and appears to be properly registering my aspect.
> What is bothering me at this point is that the weaver is supposed to
> find my call to the interface. It seems to be starting but it just isn't
> actually applying the advice.
That the weaver bundle is started is good. Are you sure the framework
hook is configured correctly? For example using this option:
-Dosgi.framework.extensions=org.eclipse.equinox.weaving.hook
There should be something appearing like:
"info Adding AspectJ hooks..."
If that doesn't appear, something is broken before the actual weaving
can happen...
-Martin
|
|
|
Powered by
FUDForum. Page generated in 0.04302 seconds