📄 myaccountbean.java
字号:
/**
* Copyright (c)上海烟草(集团)公司与上海康时信息系统有限公司。
*/
package com.myejb.imp;
import javax.ejb.Remote;
import javax.ejb.Stateful;
import com.myejb.MyAccount;
/**
* 有状态会话Bean是一个可以维持自身状态的会话Bean,每个用户都有自己的一个实例.
* @author xywang
* @since 2009-2-12
* @version 1.0
*/
@SuppressWarnings("serial")
@Stateful
@Remote({MyAccount.class})
public class MyAccountBean implements MyAccount{
private int total = 0;
private int addresult = 0;
/* (非 Javadoc)
* @see com.myejb.MyAccount#Add(int, int)
*/
public int Add(int a,int b){
addresult = a + b;
return addresult;
}
/* (非 Javadoc)
* @see com.myejb.MyAccount#getResult()
*/
public int getResult(){
total += addresult;
return total;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -