adplus-dvertising
frame-decoration

Question

What will be the output of the code snippet?
    import org.aspectj.lang.annotation.Aspect;
    import org.aspectj.lang.annotation.AfterThrowing;
 
    @Aspect
    public class AfterThrowingExample 
    {
 
	  @AfterThrowing(
	    pointcut="com.xyz.myapp.SystemArchitecture.dataAccessOperation()",
	    throwing="ex")
	  public void doRecoveryActions(DataAccessException e)
          {
		throw new IllegalArgumentException();
	    // ...[/expand]
	  }
 
    }

a.

Runtime Error

b.

IllegalArgumentException

c.

BeanCreation Exception

d.

None of the mentioned

Posted under Java Spring Framework

Answer: (c).BeanCreation Exception

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the code snippet?

Similar Questions

Discover Related MCQs

Q. Which instantiation model is supported by AspectJ?

Q. Which tag in XML is used to declare @Before advice’s method?

Q. PointCut definitions can’t be reused again

Q. Annotation used to refer poincuts?

Q. Language used to set various kinds of join points

Q. Spring AOP only supports method execution join points for the beans in its IoC container

Q. The annotations must be added to the implementation class but not the interface

Q. Which of the following pattern is used to match bean name?

Q. Bean name patterns are supported by all configurations(XML,Java,AspectJ)

Q. Expressions which returns Parameters of pointcuts?

Q. Are logical operators valid in pointcut expressions?

Q. Method which checks if all target classes are matched

Q. Spring supports operations on pointcuts:-

Q. Pointcuts can be composed using:-

Q. Pointcut used to parse an AspectJ pointcut expression string

Q. Which special type of advice is used to implement an interface?

Q. Introduction advice helps in implementing multiple inheritance.

Q. In introduction advice you have to modify class to introduce new methods

Q. How does an Introduction advice do this in Spring?

Q. Annotation used to declare an introduction