File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring AOP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring AOP" Watch "Spring AOP" New topic
Author

Spring AOP

Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
I have a non Spring web app. I want to implement Spring AOP for some of the methods in our app. Those methods are not invoked using Spring Beans at all. Is there anyway we can do this? I would appreciate if someone can provide me with a sample.


$Hi/\bEr
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Shiaber Shaam wrote:I have a non Spring web app. I want to implement Spring AOP for some of the methods in our app. Those methods are not invoked using Spring Beans at all. Is there anyway we can do this? I would appreciate if someone can provide me with a sample.


Spring AOP can only advice objects that are Spring Beans. Because it creates DynamicProxies at runtime in the Initialization phase of Spring's ApplicationContext container. And that container only knows about beans you added in Spring configuration (xml, Annotations, or Java Config way)

If you want to get AOP into code you can always just use an AOP framework like AspectJ and do bytecode instrumentation.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Spring AOP
 
Similar Threads
AOP
Spring AOP / Spring AOP + AspectJ ?
AOP
Is Spring AOP really an effective strategy?
Spring AOP