CourseEJB.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:2k
源码类别:
Java编程
开发平台:
Java
- package day21ex.course;
- import javax.ejb.*;
- public abstract class CourseEJB implements EntityBean {
- protected EntityContext ctx;
- public CourseEJB() {
- }
- public abstract String getCourseId();
- public abstract void setCourseId(String courseID);
- public abstract String getName();
- public abstract void setName(String name);
- public abstract double getFee();
- public abstract void setFee(double fee);
- public void ejbActivate() {
- System.out.println("ejbActivate() called.");
- }
- public void ejbRemove() {
- System.out.println("ejbRemove() called.");
- }
- public void ejbPassivate() {
- System.out.println("ejbPassivate () called.");
- }
- public void ejbLoad() {
- System.out.println("ejbLoad() called.");
- }
- public void ejbStore() {
- System.out.println("ejbStore() called.");
- }
- public void setEntityContext(EntityContext ctx) {
- System.out.println("setEntityContext called");
- this.ctx = ctx;
- }
- public void unsetEntityContext() {
- System.out.println("unsetEntityContext called");
- this.ctx = null;
- }
- public void ejbPostCreate(String courseID, String name, double fee) {
- System.out.println("ejbPostCreate() called");
- }
- public String ejbCreate(String courseID, String name, double fee)
- throws CreateException {
- System.out.println("ejbCreate() called");
- setCourseId(courseID);
- setName(name);
- setFee(fee);
- return null;
- }
- }