Explain the Around advice?

Explain the Around advice?

The MethodInterceptor provides the ability to do both before advice and after advice in one advice object:
  public interface MethodInterceptor{
  Object invoke(MethodInvocation invocation) throws Throwable;

There are two important difference between MethodInterceptor and the both before and after advice. First, the method interceptor implementation controls the target method invocation, and this invocation done by calling MethodInvocation.proceed(). Second, MethodInterceptor gives you control over what object is returned.

Date:2002-02-09 00:00:00

Post Your Answers

User Email:

User Name:

Related Spring sub Links

Spring sub interview questions and answers for experienced and fresher