Skip to content

Instantly share code, notes, and snippets.

@willianantunes
Created August 11, 2018 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willianantunes/6cd38b53fbe9590f76902c94b50794ff to your computer and use it in GitHub Desktop.
Save willianantunes/6cd38b53fbe9590f76902c94b50794ff to your computer and use it in GitHub Desktop.
@Aspect
@Component
public class SampleControllerAspect {
private static final Logger LOGGER = LoggerFactory.getLogger(SampleControllerAspect.class);
@Around("execution(* br.com.globo.controller.SampleController.sample(String)) && args(honestSampleHeader)")
public ModelAndView aroundWallMethod(ProceedingJoinPoint proceedingJoinPoint, String honestSampleHeader) throws Throwable {
LOGGER.debug("What was intercepted: {}", honestSampleHeader);
return (ModelAndView) proceedingJoinPoint.proceed(List.of(encodeFromHeaderParameter(honestSampleHeader)).toArray());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment