PDE Eclipse Application and Equinox Weaving AspectJ [message #1759146] |
Thu, 06 April 2017 23:31 |
Daniel San Martín Messages: 45 Registered: October 2012 |
Member |
|
|
Hello,
I am trying to run aspects when some methods are called by the application. I followed a lot of tutorials spread in the internet but they are too old so I do not know if they are still correct.
Ok this is what I have in my project
Where RE and UI are eclipse applications developed with SWT. So, to lunch the application the user chose a java project with the second button of the mouse and run my application by means a menu. The utils project is a plug-in that contains my aspects and target application has all bundles needed in order to execute properly my application.
The manifest of utils (containing the aspects) is the following:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Utils
Bundle-SymbolicName: br.ufscar.SaS.utils
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: br.ufscar.sas.utils.Activator
Require-Bundle: org.eclipse.core.runtime,
org.aspectj.runtime,
org.eclipse.emf.ecore
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: br.ufscar.sas.aspects;aspects="AddReturn"
Eclipse-SupplementBundle: br.ufscar.sas.createKDM
Bundle-ClassPath: lib/BaseX853.jar,
The aspect that I am trying to execute is the following:
package br.ufscar.sas.aspects;
import org.eclipse.emf.ecore.resource.Resource;
public aspect AddReturn {
pointcut callCreateKDM(): call(private void createKDMFile(Resource, String));
after() : callCreateKDM() {
System.out.println("It works!");
}
}
And the code that I want to crosscut is the following :
package br.ufscar.sas.createKDM;
...
...
//Generates the KDM file
try
{
createKDMFile(javaResource, javaProjectName);
} catch (IOException e) {e.printStackTrace();}
I performed all the configurations needed, for example,
and
Then I try to run it, and in the console these messages are shown:
So I think all is correct.
Then I run the application:
And the message "It works" must appear after the method is called, but nothing occurs,
Please help me because I am stuck in this several days.
Thank you,
Daniel.
-
Attachment: 1.png
(Size: 18.44KB, Downloaded 501 times) -
Attachment: 2.png
(Size: 44.12KB, Downloaded 466 times) -
Attachment: 3.png
(Size: 28.43KB, Downloaded 457 times) -
Attachment: 4.png
(Size: 19.17KB, Downloaded 432 times) -
Attachment: 5.png
(Size: 75.60KB, Downloaded 474 times)
|
|
|
|
Powered by
FUDForum. Page generated in 0.03450 seconds