01: package org.objectweb.jonas.jtests.beans.relation.tier;
02:
03: import javax.ejb.*;
04:
05: /**
06: *
07: * Sequence Block Entity Bean
08: *
09: */
10: public abstract class SequenceBean implements EntityBean {
11:
12: /**
13: * @ejb.create-method
14: */
15: public String ejbCreate(String name)
16: throws javax.ejb.CreateException {
17: setName(name);
18: setIndex(0);
19: return null;
20: }
21:
22: public void ejbPostCreate(String name)
23: throws javax.ejb.CreateException {
24: }
25:
26: /**
27: * Returns the index
28: * @return the index
29: */
30: public abstract int getIndex();
31:
32: public abstract void setIndex(int newIndex);
33:
34: /**
35: * Returns the name
36: * @return the name
37: */
38: public abstract String getName();
39:
40: public abstract void setName(java.lang.String newName);
41:
42: public int getValueAfterIncrementingBy(int blockSize) {
43: setIndex(getIndex() + blockSize);
44: return getIndex();
45: }
46: }
|