Spring Tutorial Home

  • Managing Database Transactions
  • Remoting in Spring
  • Working with the Web Layer

Spring Home

Java Resources

Community

Site

Types Of Advice


 The following are the types of Advices :-



  1. Before advice: The Before Advice executes before a join point. They can not prevent execution flow proceeding to the join point unless they throw an exception.

  2. After returning advice: After Returning Advice will be executed after a join point completes normally. If it throws exception then this type of advice will not be executed.

  3. After throwing advice: After Throwing Advice will be executed if a method exits by throwing an exception.

  4. After (finally) advice: After Advice shall be executed regardless of the means by which a join point exits normally or with exception.

  5. Around advice: Around Advice is the most powerful kind of advice. Around advice can perform custom behavior before and after the method invocation. It has a capability to choose whether to proceed to the join point or to shortcut the advised method execution by returning its own return value or throwing an exception.


 


Features of Spring Advice


 The following are the features of Spring AOP :- 



  1. Spring AOP is implemented in pure Java

  2. Spring AOP currently supports only method execution join points

  3. Spring AOP's approach is to provide a close integration between AOP implementation and Spring IoC to help solve enterprise applications.

  4. Aspects are configured using normal bean definition syntax so there is no need to learn anything extra for AOP.

                    

Copyright © 2012 VisualBuilder. All rights reserved