๐๏ธ @Before
The @Before annotation in Spring AOP is used to define a type of advice known as "before advice." This advice is executed before the join point (usually a method execution) is reached. It allows you to perform actions or checks before the actual method logic is executed.
๐๏ธ @After
The @After annotation in Spring AOP is used to define a type of advice known as "after advice." This advice is executed after the join point (usually a method execution) has completed, regardless of whether the method completed normally or threw an exception.
๐๏ธ @AfterReturning
The @AfterReturning annotation in Spring AOP is used to define a type of advice known as "after returning advice." This advice is executed after a join point (typically a method execution) completes successfully, i.e., the method returns a result without throwing an exception. It allows you to perform actions based on the return value of the method.
๐๏ธ @AfterThrowing
The @AfterThrowing annotation in Spring AOP is used to define a type of advice known as "after throwing advice." This advice is executed when a join point (typically a method execution) throws an exception. It allows you to handle exceptions in a centralized manner, perform logging, or take corrective actions when errors occur.
๐๏ธ @Around
The @Around annotation in Spring AOP defines a type of advice known as "around advice." This is the most powerful and flexible type of advice, as it allows you to control the execution of the join point (method) itself. With @Around advice, you can choose to proceed with the original method call, modify its arguments, change its return value, or even skip it entirely.