Skip to content

Commit

Permalink
optimize ...
Browse files Browse the repository at this point in the history
  • Loading branch information
yangfuhai committed May 22, 2018
1 parent 0374371 commit 796cb69
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/java/aop/AopConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.jfinal.config.Interceptors;
import io.jboot.server.listener.JbootAppListenerBase;
import io.jboot.web.fixedinterceptor.FixedInterceptors;

/**
* @author Michael Yang 杨福海 ([email protected]
Expand All @@ -17,4 +18,9 @@ public void onInterceptorConfig(Interceptors interceptors) {
interceptors.addGlobalServiceInterceptor(new AOPInterceptor());
System.out.println("onInterceptorConfig");
}

@Override
public void onFixedInterceptorConfig(FixedInterceptors fixedInterceptors) {
fixedInterceptors.add(new FixedTestInterceptor());
}
}
22 changes: 22 additions & 0 deletions src/test/java/aop/FixedTestInterceptor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package aop;

import io.jboot.web.fixedinterceptor.FixedInterceptor;
import io.jboot.web.fixedinterceptor.FixedInvocation;

/**
* @author Michael Yang 杨福海 ([email protected]
* @version V1.0
* @Title: (请输入文件名称)
* @Description: (用一句话描述该文件做什么)
* @Package aop
*/
public class FixedTestInterceptor implements FixedInterceptor {


@Override
public void intercept(FixedInvocation inv) {
System.out.println("FixedTestInterceptor invoked before:"+inv.getMethodName());
inv.invoke();
System.out.println("FixedTestInterceptor invoked after:"+inv.getMethodName());
}
}

0 comments on commit 796cb69

Please sign in to comment.