helloejbbean.java
来自「java的一系列产品中包括jsme,jmse,j2ee,本文件提供j2ee实现的」· Java 代码 · 共 43 行
JAVA
43 行
/*
*
* Copyright 2002 Author,Zhang Hongzhan. All Rights Reserved.
*
* This software is the proprietary information of Author..
*
*/
package helloejb;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import java.math.*;
public class HelloEJBBean implements SessionBean{
private SessionContext ctx;
public void setSessionContext(SessionContext sc){
ctx=sc;
}
public String HelloWorld(){
return "Hello World,Welcome learn EJB!";
}
BigDecimal dollarRate = new BigDecimal("8.2400");
BigDecimal poundRate = new BigDecimal("12.5000");
public BigDecimal dollarToRMB(BigDecimal dollars) {
BigDecimal result = dollars.multiply(dollarRate);
return result.setScale(2,BigDecimal.ROUND_UP);
}
public BigDecimal poundToRMB(BigDecimal pound) {
BigDecimal result = pound.multiply(poundRate);
return result.setScale(2,BigDecimal.ROUND_UP);
}
public HelloEJBBean() {}
public void ejbCreate() {}
public void ejbRemove() {}
public void ejbActivate() {}
public void ejbPassivate() {}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?