public interface BookDAO (){
List<Book> getBookList(String bookType);
}
public class BookDAOImpl implements BookDAO {
@MyAnnotation
List<Book> getBookList(String bookType) {
//impl code
}
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MyAnnotation{
}
@Around("execution(@path.to.annotation.MyAnnotation * *(..))")
public Object checkAroundGetList(final ProceedingJoinPoint pjp) throws
Throwable {
Object[] args = pjp.getArgs();
// implemented code
return obj;
}
public interface BookDAO (){
@MyAnnotation
List<Book> getBookList(String bookType);
}