-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]) | ||
|
@@ -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()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} |