Jetty remote debug:
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar target/your-server.jar
@Target({ElementType.METHOD})
<context:component-scan base-package="a.b.c.d,a.bc.a"> <context:exclude-filter type="regex" expression=".*Test"/> <context:exclude-filter type="regex" expression=".Test*"/> </context:component-scan>
<context:component-scan base-package="a.b.c.server"/>
@Aspect @Component public class PerfLoggingAdvice { private static final Logger perfLog = Logger.getLogger(ServerConst.PERF_LOG); @Pointcut("execution(a.b.c.d.PageData<a.b.c.d.e.Entity> a.b.c.db.hibernate.SomeDataDB.get*(..)) || " + "execution(* a.b.c.d.impl.Some.getList(..)) " ) public void somePoint() {} @Around("somePoint()") public Object someAction(ProceedingJoinPoint joinPoint) throws Throwable { Object result = null; if (isMethodAnnotated(joinPoint)) { // code here will be executed before every method in package a.b.c.d with annotation @ActionMethod } else { result = joinPoint.proceed(); } return result; } /** * Returns true if the specified method (joinPoint) is annotated with * {@link ActionMethod } annotation. * */ private boolean isMethodAnnotated(ProceedingJoinPoint joinPoint) { MethodSignature ms = (MethodSignature) joinPoint.getSignature(); Method mInterf = ms.getMethod(); try { Method m = joinPoint.getTarget().getClass().getMethod(mInterf.getName(), mInterf.getParameterTypes()); return m.getAnnotation(ActionMethod.class) != null; } catch (NoSuchMethodException e) { return false; } } }