countbean.java
来自「EJB3.0请一定要上载质量高而且本站没有的源码」· Java 代码 · 共 48 行
JAVA
48 行
package examples.session.stateful_dd;
import java.io.Serializable;
/**
* A Stateful Session Bean Class that shows the basics of
* how to write a stateful session bean.
*
* This Bean is initialized to some integer value. It has a
* business method which increments the value.
*
* The annotations below declare that:
* <ul>
* <li>this is a Stateful Session Bean
* <li>the bean's remote business interface is <code>Count</code>
* <li>any lifecycle callbacks go to the class <code>CountCallbacks</code>
* </ul>
*/
public class CountBean implements Count {
/** The current counter is our conversational state. */
private int val;
/**
* The count() business method.
*/
public int count() {
System.out.println("count()");
return ++val;
}
/**
* The set() business method.
*/
public void set(int val) {
this.val = val;
System.out.println("set()");
}
/**
*/
public void remove() {
System.out.println("remove()");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?