Friday, 15 March 2013

aspectj - Aspect not working witha spring bean -


I'm trying to create a simple aspect here, my simple spring bean

  Public class SimpleService {Public Zero say hello () {System.out.println ("hi"); }}  

Here is my aspect square

  @ accidental public class simple aspect {@ beer ("execution (say hello (say hello))) public Enter zero () {System.out.println ("login" ..); }}  

This is my configuration file

  & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Bem xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: aop = "http: // www. Springframework.org/schema/aop "xsi: schema location =" http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.1.xsd http: //www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> & Lt; Aop: AspectJ-autoproxy / & gt; & Lt; Bean id = "service" class = "com.schatt.service.SimpleService" & gt; & Lt; / Bean & gt;  

My understanding was that when I try to start simple service, the first aspect will be called and after that say hello will be called. But the aspect is not starting to understand what I am missing.

Proxying apply.)

  & lt; Bean id = "simple asp.net" class = "package-name. Simple shape" & gt; & Lt; / Bean & gt;  

No comments:

Post a Comment