KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > relation > tier > SequenceBean


1 package org.objectweb.jonas.jtests.beans.relation.tier;
2
3 import javax.ejb.*;
4
5 /**
6  *
7  * Sequence Block Entity Bean
8  *
9  */

10 public abstract class SequenceBean implements EntityBean {
11
12    /**
13     * @ejb.create-method
14     */

15    public String JavaDoc ejbCreate(String JavaDoc name) throws javax.ejb.CreateException JavaDoc {
16       setName(name);
17       setIndex(0);
18       return null;
19    }
20
21    public void ejbPostCreate(String JavaDoc name) throws javax.ejb.CreateException JavaDoc {
22    }
23
24    /**
25     * Returns the index
26     * @return the index
27     */

28    public abstract int getIndex();
29    public abstract void setIndex(int newIndex);
30
31    /**
32     * Returns the name
33     * @return the name
34     */

35    public abstract String JavaDoc getName();
36    public abstract void setName(java.lang.String JavaDoc newName);
37
38    public int getValueAfterIncrementingBy(int blockSize) {
39       setIndex(getIndex() + blockSize);
40       return getIndex();
41    }
42 }
43
Popular Tags