Spring AOP
June 23, 2020

M02 Q08 What is the JoinPoint argument used for?

A JoinPoint argument is an object that can be used to retrieve additional information about join point during execution. JoinPoint needs to be the first parameter of Advice, only, in that case, Spring Framework will inject JoinPoint into advice method.

JoinPoint is supported in following advice types:

  • @Before
  • @After
  • @AfterReturning
  • @AfterThrowing

Examples of information that you can retrieve from JoinPoint:

  • The string representation of JoinPoint
  • Arguments of JoinPoint (for example Method Arguments)
  • Signature of JoinPoint (for example Method Signature)
  • Kind / Type of JoinPoint
  • Target / This object being proxied