KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > bsf > remoting > StatefulTestBean


1 package org.bsf.remoting;
2
3 import org.bsf.commons.ejb.SessionAdapterBean;
4
5 import javax.ejb.CreateException JavaDoc;
6
7 /**
8  * EJB de test
9  *
10  * @ejb:bean type="Stateful"
11  * name="StatefulTest"
12  * jndi-name="ejb/StatefulTest"
13  * generate="true"
14  * view-type="remote"
15  *
16  * @ejb:home extends="javax.ejb.EJBHome"
17  * generate="remote"
18  *
19  * @ejb:interface extends="javax.ejb.EJBObject"
20  * generate="remote"
21  *
22  * @ejb:transaction type="Required"
23  *
24  * @jonas.bean
25  * ejb-name="StatefulTest"
26  * jndi-name="ejb/StatefulTest"
27  */

28 public class StatefulTestBean extends SessionAdapterBean {
29
30     private static int eJBCount = 0;
31
32     /**
33      * The EJB Name
34      */

35     private String JavaDoc name = null;
36
37     private int callCount = 1;
38
39
40     public void ejbCreate() throws CreateException JavaDoc {
41         super.ejbCreate();
42         name = "EJB"+ eJBCount++;
43     }
44
45     /**
46      * @return the name of the current EJB
47      *
48      * @ejb:interface-method
49      */

50     public String JavaDoc getEJBName(){
51         return name;
52     }
53
54     /**
55      * @return the name of the current EJB
56      *
57      * @ejb:interface-method
58      */

59     public String JavaDoc call(){
60         return "call " + callCount++ + " on "+ name;
61     }
62
63
64 }
65
Popular Tags