public class CountBean implements SessionBean{ // 当前的计数值就是对话状态 public int val; private SessionContext ctx; //EJB 方法 public int count(){ System.out.println("count()"); return ++val; }
//EJB 必须的方法
public void ejbCreate(int val) throws CreateException{ this.val=val;
System.out.println("ejbCreate()");
}
public void ejbRemove(){
System.out.println("ejbRemove()");
}
public void ejbActivate(){
System.out.println("ejbActivate()");
}
public void ejbPassivate(){
System.out.println("ejbPassivate()");
}
public void setSessionContext(SessionContext ctx){