Spring AOP Commands

Published: 2019-08-04, Updated: 2020-01-04

Explicando as anotacoes

Intercepta qualquer metodo de qualquer classe dentro do pacote br.jmx com qualquer quantidade de parametros

@Before("execution(* br.jmx.*.*(..))")

Intercepta qualquer metodo de qualquer classe dentro do pacote e do subpacote ``br.jmx` com qualquer quantidade de parametros

@Before("execution(* br.jmx..*.*(..))")

Pegar os parametros via AOP

@Before("execution(* br.jmx..*.*(..))")

public void jmxCallIntercept(final JoinPoint joinPoint){ jointPoint.getArgs(); ...

Exemplo de @AfterThrowing

@AfterThrowing(
 pointcut = JMX_INTERCEPT_AOP_EXPRESSION,
    throwing = "ex"
)
public void jmxAfterThrowCallIntercept(final JoinPoint joinPoint, Throwable ex){
...

Exemplo de @AfterReturning

@AfterReturning(
    pointcut = JMX_INTERCEPT_AOP_EXPRESSION,
    returning = "returnValue"
)
public void jmxAfterCallIntercept(final JoinPoint joinPoint, final Object returnValue){
..

Atalhos de teclado do Youtube Cortar video no blender

Comments