Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Two questions about AspectJ possibilities before I dive in
Two questions about AspectJ possibilities before I dive in [message #542728] Fri, 25 June 2010 17:47 Go to next message
Daniel Kashtan is currently offline Daniel Kashtan
Messages: 15
Registered: March 2010
Junior Member
Hello all,

I am currently in the process of getting Equinox Aspects going for my OSGI based project. Please see the Equinox forums here if you know your way around Equinox Aspects. Before I try to implement some things I believe AspectJ can do, I'd like to know if my plans are sane.

1) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I then trigger adding a certain block of code?

2) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I enforce that a certain interface for this class must be implemented?

Also, am I in the right board for these questions? I didn't see a general AspectJ forums.
Re: Two questions about AspectJ possibilities before I dive in [message #542755 is a reply to message #542728] Fri, 25 June 2010 20:44 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 369
Registered: July 2009
Senior Member
There is an aspectj mailing list where these kinds of questions are asked and answered on a regular basis. See: http://eclipse.org/aspectj.

I think that you have phrased both of these questions a bit wrongly.

1) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I then trigger adding a certain block of code?

There are many annotations that are specific to aspectj. The only ones that will trigger adding a block of code are the advice annotations (eg- @before, @around, and @after*). You also need the @Aspect annotation present on the class declaration so that the weaver knows to treat that class as an aspect.

I don't know what you mean by prefix. That shouldn't have anything to do with things.

2) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I enforce that a certain interface for this class must be implemented?

Since I'm not really sure what you are trying to do, a code sample from you would help.
Re: Two questions about AspectJ possibilities before I dive in [message #543131 is a reply to message #542755] Mon, 28 June 2010 13:48 Go to previous messageGo to next message
Daniel Kashtan is currently offline Daniel Kashtan
Messages: 15
Registered: March 2010
Junior Member
Sorry about my confusing questions, looking at them now I do not know why I wrote them like that Sad

I also think that I can find solutions to these problems and I just need to dive in first. Maybe then I can ask better and more intelligible questions Smile
Re: Two questions about AspectJ possibilities before I dive in [message #543171 is a reply to message #543131] Mon, 28 June 2010 15:37 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 369
Registered: July 2009
Senior Member
No problem. Please ask here or on the mailing list if you have any more questions.
Re: Two questions about AspectJ possibilities before I dive in [message #601060 is a reply to message #542728] Fri, 25 June 2010 20:44 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 369
Registered: July 2009
Senior Member
There is an aspectj mailing list where these kinds of questions are asked and answered on a regular basis. See: http://eclipse.org/aspectj

I think that you have phrased both of these questions a bit wrongly.

1) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I then trigger adding a certain block of code?

There are many annotations that are specific to aspectj. The only ones that will trigger adding a block of code are the advice annotations (eg- @before, @around, and @after*). You also need the @Aspect annotation present on the class declaration so that the weaver knows to treat that class as an aspect.

I don't know what you mean by prefix. That shouldn't have anything to do with things.

2) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I enforce that a certain interface for this class must be implemented?

Since I'm not really sure what you are trying to do, a code sample from you would help.
Re: Two questions about AspectJ possibilities before I dive in [message #601084 is a reply to message #601060] Mon, 28 June 2010 13:48 Go to previous message
Daniel Kashtan is currently offline Daniel Kashtan
Messages: 15
Registered: March 2010
Junior Member
Sorry about my confusing questions, looking at them now I do not know why I wrote them like that :(

I also think that I can find solutions to these problems and I just need to dive in first. Maybe then I can ask better and more intelligible questions :)
Re: Two questions about AspectJ possibilities before I dive in [message #601087 is a reply to message #601084] Mon, 28 June 2010 15:37 Go to previous message
Andrew Eisenberg is currently offline Andrew Eisenberg
Messages: 369
Registered: July 2009
Senior Member
No problem. Please ask here or on the mailing list if you have any more questions.
Previous Topic:Installation of AJDT 2.1.0 in Eclipse 3.6
Next Topic:Struggling with how to make a simple poincut
Goto Forum:
  


Current Time: Sun Oct 26 04:33:43 GMT 2014

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

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