You can view the tutorials best in Google Chrome, Mozilla Firefox, Opera, higher version of Internet Explorer

Spring AOP Around Advice Example With Complete Explanation

Spring » On Jul 29, 2012 By Sivateja

Will see few points about Around Advice before going to do an example :-)

  • Around Advice is combination of both Before and After Advice.
  • In a single Advice it is possible to implement both Before and After services.
  • Around Advice is not given by spring framework and it is from Open Source implementation called AOP alliance.
  • Around Advice can be used by any framework which supports AOP.
  • To create Around Advice, our class should implement an interface called MethodInterceptor.
  • In Around Advice, we implement Before and After Advice in a single method called invoke(), in order to separate Before an After services to execute business logic, in the middle we call proceed() method.
  • Around Advice can access the return value of business method and it can modify the value and it can return a different value back to the client, as return type is Object, but in the After Advice its not possible right, as its return type is void.

Syntax For AroundAdvice Implementation

Example On Spring AOP ThrowsAdvice

Files required…

  • spconfig.xml



By ( Java/J2EE Developer & Web Designer )
Founder of You can contact me at sivateja [at]


4 Responses to “Spring AOP Around Advice Example With Complete Explanation”
  1. abhishek says:

    Why we have not mentioned the class name for i3 in spconfig.xml

  2. Java4s says:


    Yeah its happened by mistake, now its updated :-) good observation, thank you.

  3. Shridevi says:

    How to access point-cut parameters?

  4. Meghna says:

    Thanks for the clean example Sivateja… Even this might help… Have a look…


By posting your answer, you agree to our comments policy.
So, What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs

Most Recent Tutorials
Hibernate Recent Posts
Spring Recent Posts
Struts Recent Posts
Recomandded Links
Current & UpComing Tutorials
Sitemap :
spring Hibernate struts Json Ajax Log4j Log4j coreJava Servlets Web Services

  Web Services [ SOAP ], JSP
Facebook_Java4s  Twitter_Java4s  GooglePlus_Java4s  Youtube_Java4s 
© 2010 - 2015 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.