⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 auditorinterceptor.java

📁 EJB3.0请一定要上载质量高而且本站没有的源码
💻 JAVA
字号:
package examples.stateless.interceptors;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;

public class AuditorInterceptor {
	@AroundInvoke
	public Object checkCost(InvocationContext inv) throws Exception {
		if (inv.getMethod().getName().startsWith("getTax")) {
			Object[] o = inv.getParameters();
			double cost = ((Double)o[0]).doubleValue();
			if (cost > 50) {
				System.out.println("Cost is > 50!");
			}
		}
		return inv.proceed();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -