KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ejb > CustomerBMPBean


1 package test.ejb;
2
3 import test.dao.*;
4 import test.interfaces.CustomerData;
5 import test.interfaces.CustomerPK;
6 import test.interfaces.CustomerNormalValue;
7
8 import java.util.*;
9 import javax.ejb.*;
10
11 /**
12  * This is a customer bean. It is an example of how to use the XDoclet tags.
13  *
14  * @ejb.bean
15  * jndi-name="ejb/bank/CustomerBMP"
16  * name="CustomerBMP"
17  * type="BMP"
18  * use-soft-locking="true"
19  * view-type="remote"
20  * @ejb.ejb-ref
21  * ejb-name="CustomerBMP"
22  * @ejb.security-role-ref
23  * role-link="Administrator"
24  * role-name="admin"
25  * @ejb.permission
26  * role-name="Teller"
27  * @ejb.transaction
28  * type="Required"
29  * @ejb.pk
30  * class="test.interfaces.CustomerPK"
31  * generate="false"
32  * @ejb.interface
33  * generate="false"
34  * remote-class="test.interfaces.Customer"
35  * @ejb.home
36  * generate="false"
37  * remote-class="test.interfaces.CustomerHome"
38  * @ejb.data-object
39  * class="test.interfaces.CustomerData"
40  * generate="false"
41  * @ejb.dao
42  * class="test.dao.CustomerDAO"
43  * impl-jndi="dao"
44  * @jboss.ejb-ref-jndi
45  * jndi-name="ejb/bank/Account"
46  * ref-name="bank/Account"
47  * @ejb.env-entry
48  * name="dao"
49  * type="java.lang.String"
50  * value="test.dao.CustomerExampleDAO"
51  *
52  * @jonas.bean ejb-name="CustomerBMP"
53  * jndi-name="CustomerBMPHome"
54  * @jonas.ejb-ref ejb-ref-name="ejb/CustomerBMP"
55  * jndi-name="CustomerBMP"
56  */

57 public abstract class CustomerBMPBean
58         extends CustomerBean
59 {
60     
61     /**
62      * @ejb.create-method
63      */

64     public Object JavaDoc ejbCreate(CustomerData detail)
65             throws CreateException
66     {
67         throw new IllegalStateException JavaDoc("Creation of Customer is not possible");
68     }
69     
70     public void ejbPostCreate(CustomerData detail) {}
71     
72     /**
73      * @ejb.create-method
74      */

75     public Object JavaDoc ejbCreate(CustomerNormalValue detail)
76             throws CreateException
77     {
78         throw new IllegalStateException JavaDoc("Creation of Customer is not possible");
79     }
80     
81     public abstract Collection ejbFindAll()
82             throws FinderException;
83     
84     public abstract CustomerPK ejbFindByPrimaryKey(CustomerPK pk)
85             throws FinderException;
86     
87     /**
88      * @ejb.home-method
89      * @dao.call name="backup"
90      */

91     public void ejbHomeCopyToArchive(CustomerPK pk)
92     {
93         // does nothing with CMP, BMP will override
94
}
95
96 }
97
Popular Tags