point cut of domain objects created outside spring container

the @Configurable annotation is the cure, basically, its till aspect/aspectJ to detect if any instantiation of beans marked as Configurable; and put into spring container if yes.


@Configurable

 

and it’s only put into spring container after the bean is manually instantiated. So autowired stuff won’t work in this manually instantiated bean still.

And  in order to have spring beans loaded/injected into aspects

    <bean id="aspect"
   class="com.bfm.app.cim.helper.PageDecorator"
   factory-method="aspectOf"  />

 

btw, I dont like spring docs now. it becomes so bulky !
8.8.1 Using AspectJ to dependency inject domain objects with Spring

8.8.3 Configuring AspectJ aspects using Spring IoC

http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html

Advertisements

Author: lwpro2

Java J2EE professional

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s