Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to rewrite a class with AspectJ

Thanks Simone, yes this is exactly what I want... but another question is
that this is used using 'declare' and as far as I know declare is placed in
aspect definition. How can I place it in a for-loop.

Let me tell you the scenario may be I am in wrong way...

I am trying to implement an observer pattern in EJB 3.0. I saw many
implementation using aspectJ but mine is a little different. The difference
is that I want to inject observer into observable... 

Because session beans are managed object and in my case both observer and
observable supposed to be session beans I want application server injects
observer session beans in observable SB and then call observer methods 

These observer and observable methods will be annotated by the developer
with say @Observer and @Observable

What I wanted was to look for @Observer methods and find their interface and
put them like this:

@EJB
private ObserverInterface1 observer1

than each time the determined method is called I can call
observer1.notifyObserver() method

Can you please help me on this?




Simone Gianni-2 wrote:
> 
> Hi  Mohammad,
> maybe you are loooking for the declare annotation statement?
> http://www.eclipse.org/aspectj/doc/next/adk15notebook/annotations-declare.html
> 
> Simone
> 
> 


-----
--
Regards

Mohammad Norouzi

Help each other to reach the future faster

http://pixelshot.wordpress.com Pixelshot Photoblog 

http://brainable.blogspot.com Brainable Blog 


-- 
View this message in context: http://old.nabble.com/How-to-rewrite-a-class-with-AspectJ-tp28280867p28287273.html
Sent from the AspectJ - users mailing list archive at Nabble.com.



Back to the top