@Aspect @Component public class MyAspect { @Before("execution(* com.example.MyExampleClass.example(..))") public void logBefore(JoinPoint pjp) throws Throwable { System.out.println("before..."); } }