[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] obtaining ajdt cross cutting information

Hi Andrew,

I wish to find information about which pointcut is cutting at which joinpoint in the source code.

Pointcut

Advice Type

Aspect

Joinpoint

Joinpoint class

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I was trying to print out the information that was earlier posted for the sample TJB example.

I tried again with the new set of instructions that you posted. I am having the following problems:

1.       The type org.eclipse.core.runtime.IAdaptable cannot be resolved. It is indirectly referenced from required .class files

 

I tried to google for the package that contains IAdaptable. I added both org.eclipse.core.runtime and org.eclipse.equinox.common. But I am still getting the error message. Please find attached a screenshot of the package explorer view of my TJB example and the three source code files.

2.       IRelationship cannot be resolved to a type

3.       Type mismatch: cannot convert from element type Object to String

For String targetHandle and rel.getTargets(), in the for loop.

I registered my listener with the the AJBuilder class in Demo.java's main function by adding the following line in the main function.

   AJBuilder.addAdviceListener(new MyAdviceListener());

Could you tell me how can I fix these problems?

At http://www.eclipse.org/ajdt/developers.php#q:cvs

4.       How can I connect the AJDT CVS repository and download?

path:/cvs/root/tools

I think cvsroot worked instead of cvs/root worked for me. cvsroot is given is mentioned in question 2.

Tml

 



On Mon, Dec 1, 2008 at 9:35 AM, Andrew Eisenberg <andrew@xxxxxxxxxxxx> wrote:
Yes, this is a bit out of date.  It is for AJDT 1.4, now we are at
1.6.  I will update the documentation.  The getCurrentProject() method
doesn't make any sense because there is no "current project" in a
multi-project workspace.

If you are looking for crosscutting information for a particular
IProject or IJavaElement, you need to pass it to the
AJProjectModelFactory:

IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject("MyProject");
AJProjectModelFacade model =
AJProjectModelFactory.getInstance().getModelForProject(project);
AJRelationshipType[] relsTypes = AJRelationshipManager
              .getAllRelationshipTypes();
model.getRelationshipsForProject(relTypes);

--or--

for a particular IJavaElement
IJavaElement elt = <some_java_elt>;
AJProjectModelFacade model =
AJProjectModelFactory.getInstance().getModelForJavaElementelt);
model.getRelationshipsForElement(elt, relTypes);

AJProjectModelFacade also has a bunch of other interesting methods,
such as those that allow you to translate between IJavaElements and
IProgramElements (the units of the AspectJ model).


Note a few things:

1. AJProjectModelFacade objects are a lightweight way to access the
underlying AspectJ model.  They should not be held for longer than you
need them. Use them and discard them before the next build.
2. AJProjectModelFacade objects only have data after the project has
been built.  So, the hasModel() method checks to see if the underlying
AspectJ Model actually exists.

Please explain what you are trying to do and I will let you know how
to use AJDT to get there.

--a

On Mon, Dec 1, 2008 at 1:30 AM, tamal nath <tmlnth@xxxxxxxxx> wrote:
> Hi,
>
> I was trying to obtian the AJDT cross cutting information for TJB example as
> shown in the AJDT wiki:
> http://wiki.eclipse.org/index.php/Developer%27s_guide_to_building_tools_on_top_of_AJDT_and_AspectJ
>
> But I found that getCurrentProject is now undefined! Also most of the
> methods are deprecated. Is there a new method which does the same job as
> getCurrentProject? Is there a better way to do this in the new version?
>
> IProject project = AspectJPlugin.getDefault().getCurrentProject();
>
> Tml
>
>
>
> _______________________________________________
> 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

Attachment: tjp.zip
Description: Zip archive

Attachment: CrossCuttingTJB.bmp
Description: Windows bitmap