?? countbean.java
字號:
package com.wiley.compBooks.roman.session.count;
import javax.ejb.*;
/**
* Demonstration Stateful Session Bean. This Bean is initialized
* to some integer value, and has a business method which
* increments the value.
*
* This example shows the basics of how to write a stateful
* session bean, and how passivation/activation works.
*/
public class CountBean implements SessionBean {
private transient SessionContext ctx;
// The current counter is our conversational state.
public int val;
//
// Business methods
//
/**
* Counts up
*/
public int count() {
System.out.println("count()");
return ++val;
}
//
// EJB-required methods
//
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) {
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -