KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ejb > TellerBean


1 package test.ejb;
2
3 import test.interfaces.Account;
4
5 import javax.ejb.*;
6
7 /**
8  * This is a teller bean. It is an example of how to use the XDoclet tags.
9  *
10  * @ejb.bean name="Teller"
11  * description="Teller example bean"
12  * jndi-name="ejb/bank/Teller"
13  * type="Stateless"
14  *
15  * @ejb.ejb-ref ejb-name="Account"
16  * ref-name="ejb/bank/Account"
17  *
18  * @jboss.ejb-local-ref ref-name="File"
19  * jndi-name="blah/File"
20  *
21  * @ejb.ejb-ref ejb-name="Customer"
22  *
23  * @ejb.security-role-ref role-link="Administrator"
24  * role-name="admin"
25  *
26  * @ejb.permission role-name="Teller"
27  * @ejb.permission role-name="Administrator"
28  *
29  * @ejb.transaction type="Required"
30  * @ejb.transaction-type type="Container"
31  *
32  * @ejb.resource-ref res-auth="Container"
33  * res-name="jdbc/DBPool"
34  * res-type="javax.sql.DataSource"
35  *
36  * @soap.service urn="TellerService"
37  *
38  * @jboss.resource-ref res-ref-name="jdbc/DBPool"
39  * resource-name="MyDataSourceManager"
40  *
41  * @jboss.container-configuration name="Standard Stateless SessionBean"
42  *
43  * @jboss.ejb-ref-jndi jndi-name="ejb/bank/Account"
44  * ref-name="bank/Account"
45  *
46  * @weblogic.pool initial-beans-in-free-pool="1"
47  * max-beans-in-free-pool="3"
48  *
49  * @weblogic.stateless-clustering stateless-bean-call-router-class-name="Whatever"
50  * stateless-bean-is-clusterable="True"
51  * stateless-bean-load-algorithm="Whazzup"
52  * stateless-bean-methods-are-idempotent="Sure"
53  *
54  * @websphere.bean timeout="239"
55  * @jonas.bean ejb-name="Teller"
56  * jndi-name="TellerHome"
57  * @jonas.ejb-ref ejb-ref-name="ejb/bank/Account"
58  * jndi-name="Account"
59  * @jonas.ejb-ref ejb-ref-name="ejb/Customer"
60  * jndi-name="Customer"
61  * @jonas.resource res-ref-name="jdbc/DBPool"
62  * jndi-name="jdbc_1"
63  *
64  * @author <a HREF="mailto:youremail@yourdomain.com">youremail@yourdomain.com</a>
65  */

66 public abstract class TellerBean extends BaseTellerBean implements SessionBean {
67     /**
68      * Transfer money between accounts.
69      *
70      * @ejb.interface-method view-type="remote"
71      */

72     public void transfer(Account from, Account to, float amount) {
73         try {
74             from.withdraw(amount);
75             to.deposit(amount);
76         }
77         catch (java.rmi.RemoteException JavaDoc e) {
78             throw new EJBException(e);
79         }
80     }
81
82     /**
83      */

84     public void ejbActivate() {
85     }
86
87     /**
88      */

89     public void ejbPassivate() {
90     }
91
92     /**
93      */

94     public void setSessionContext(SessionContext ctx) {
95     }
96
97     /**
98      * Remove
99      *
100      * @ejb.transaction
101      * type="Mandatory"
102      */

103     public void ejbRemove() {
104     }
105
106 }
107
Popular Tags