Advanced Concepts in Spring Boot AOP & AspectJ
Test your expertise in advanced Spring Boot AOP and AspectJ techniques.
Questions in this quiz
10 questions on Advanced Concepts in Spring Boot AOP & AspectJ. Work through them here, then start the quiz to answer them and see your score.
1.In Spring AOP, which advice type is executed after a method returns normally or throws an exception?
- AAfter advice
- BBefore advice
- CAround advice
- DAfter returning advice
2.Which of the following is a valid pointcut expression in AspectJ to match all methods in a specific package?
- Acall(* com.example..*(..))
- Bexecution(* com.example..*(..))
- Ctarget(com.example.*)
- Dwithin(com.example.*)
3.What is the primary difference between Spring AOP and AspectJ in terms of weaving?
- AAspectJ supports only proxy-based weaving
- BSpring AOP supports compile-time weaving
- CSpring AOP supports runtime weaving
- DAspectJ supports runtime weaving only
4.Which annotation is used to declare an aspect in Spring AOP?
- A@Pointcut
- B@Advice
- C@JoinPoint
- D@Aspect
5.How does AspectJ handle checked exceptions in advice methods?
- AIt requires them to be declared or handled
- BIt ignores them
- CIt logs them and continues execution
- DIt wraps them in a runtime exception
6.In AspectJ, what does the 'this' pointcut designator match?
- AThe current executing object
- BThe target object
- CThe proxy object
- DThe current executing method
7.Which of the following is true about the @Around advice in Spring AOP?
- AIt cannot modify method arguments
- BIt can short-circuit method execution
- CIt cannot access the JoinPoint
- DIt executes after the method completes
8.What is the purpose of the @DeclareParents annotation in AspectJ?
- ATo declare a new parent class
- BTo declare a new child class
- CTo bind a pointcut to a parent class
- DTo introduce new methods to existing classes
9.Which pointcut designator is used to match methods with a specific annotation in AspectJ?
- A@annotation
- Bexecution
- Cwithin
- Dargs
10.In Spring AOP, how can you access method arguments within an advice?
- AUsing JoinPoint.getArgs()
- BUsing JoinPoint.getTarget()
- CUsing JoinPoint.getSignature()
- DUsing ProceedingJoinPoint.proceed()