Declaring an aspect:-
Aspects classes are like any other normal bean and may have methods and fields
just like any other class,With the @AspectJ support enabled, any bean defined in
your application context with a class that is an @AspectJ aspect will be
automatically detected by Spring and used to configure Spring AOP.except that
they will be annotated with @Aspect as follows:
package org.r4r.in;
import org.aspectj.lang.annotation.Aspect;
@Aspect
public class LoginAspect {
}
A regular bean definition in the application context, pointing to a bean class that has the @Aspect annotation:
<bean id="loginAspect" class="org.r4r.in.LoginAspect">
<!-- configure properties of aspect here as normal -->
</bean>