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

📄 shoppingcartinterceptor.java

📁 想学习EJB的同学
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package ejb3.day2;import javax.annotation.PostConstruct;import javax.annotation.PreDestroy;import javax.ejb.Init;import javax.ejb.PostActivate;import javax.ejb.PrePassivate;import javax.interceptor.InvocationContext;import static java.lang.System.out;/** * * @author user */public class ShoppingCartInterceptor {    @PostConstruct    public void constructed(InvocationContext ctx) {        out.println("PostConstruct: " + ctx.getTarget().getClass().getName());    }        @PreDestroy    public void beforeDestroy(InvocationContext ctx) {        out.println("BeforeDestroy: " + ctx.getTarget().getClass().getName());    }    @PrePassivate    public void beforePassivate(InvocationContext ctx) {        out.println("beforePassivate: " + ctx.getTarget().getClass().getName());    }    @PostActivate    public void activated(InvocationContext ctx) {        out.println("activated: " + ctx.getTarget().getClass().getName());    }}

⌨️ 快捷键说明

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