SequenceBean.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:1k
源码类别:
Java编程
开发平台:
Java
- package examples.sequencegenerator;
- // SequenceBean.java
- import javax.ejb.*;
- abstract public class SequenceBean implements EntityBean {
- public void ejbActivate() {}
- public String ejbCreate(String name)
- {
- this.setName(name);
- this.setIndex(0);
- return null;
- }
- public void ejbLoad() {}
- public void ejbPassivate() {}
- public void ejbPostCreate(String name) {}
- public void ejbRemove() {}
- public void ejbStore() {}
- abstract public int getIndex();
- abstract public String getName();
- public int getValueAfterIncrementingBy(int blockSize)
- {
- this.setIndex(this.getIndex()+ blockSize);
- return this.getIndex();
- }
- public void setEntityContext(EntityContext unused) {}
- abstract public void setIndex(int newIndex);
- abstract public void setName(java.lang.String newName);
- public void unsetEntityContext() {}
- }