Announcement Announcement Module
Collapse
No announcement yet.
AOP Proxy not created for Some Classes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP Proxy not created for Some Classes

    Hi All,

    We are Implementing a plug-in for an existing framework. In Framework war/jar it has spring-xxx.xml files where it has bean configurations for the framework. and i have one spring.xml in my plug-in. plug-in jar would be deployed in framework specified location.

    in my spring.xml i can inject the beans which were declared in framework spring-xxx.xml files. this is fine.
    But, when it comes to aop... aop proxy objects are created for only the beans declared in the spring.xml. the below is my configuration.

    Code:
    <bean id="ratingsAndReviewsManager" class="com.mycomp.community.ratingsandreviews.manager.proxy.RatingsAndReviewsManagerProxy">
    </bean>
    
    <bean id="emailManagerSendAdvice" class="com.mycomp.community.mailcache.EmailManagerSendAdvice"/>
    
    <aop:config>
    		<aop:aspect id="perLoggingAspect" ref="emailManagerSendAdvice">			
    				<aop:around
    				pointcut="execution(* com.abcsoftware.community.impl.EmailManagerImpl.*(..))" 
    				method="captureControl"
    				/>
    				<aop:around 
    				pointcut="execution(* com.abcsoftware.community.proxy.BlogManagerProxy.*(..))"
    				method="captureControl"/>
    				
    				<aop:around 
    				pointcut="execution(* com.mycomp.community.ratingsandreviews.manager.proxy.RatingsAndReviewsManagerProxy.*(..))"
    				method="captureControl"/>
    		</aop:aspect>	
    	</aop:config>
    	
    	<bean id="emailManagerImpl1" class="com.abcsoftware.community.impl.EmailManagerImpl"
              parent="prodManager" factory-method="getInstance">
            <property name="authenticationProvider" ref="authenticationProvider"/>
        </bean>
    	
    	<bean id="emailManagerTest2" class="com.mycomp.community.mailcache.EmailManagerTest2">
    		<property name="manger" ref="emailManagerImpl"></property>
    		<property name="manger2" ref="emailManagerImpl1"></property>
    		<property name="blogManager" ref="blogManager"></property>
    		<property name="ratingsAndReviewsManager" ref="ratingsAndReviewsManager"></property>
    	</bean>
    application would be started with any instantiation errors.
    but, the proxy Class created for emailManagerImpl1, ratingsAndReviewsManager only. why is this happening like this?? is there any hierarchy in loading spring config files??
    emailManagerImpl and emailManagerImpl1 are created for same class but in different files.
    my actual problem is emailManagerImpl class has
    Code:
    send(EmailMessage  msg)
    method. this method had been called from many places in our framework. right now it is sending mails immediately... but, we want to implement mail digest functionality. so, i need to stop the messages and cache it in DB. So, am intercepting this method.

    Please let me know Spring AOP will help me or not.
    Thanks in advanced
    Murali
Working...
X