KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > stateless > containermanaged > ejbref > SLSBEjbRefMethodInjection


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: SLSBEjbRefMethodInjection.java 434 2006-05-09 12:48:37Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.ejbref;
26
27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkBeanRef;
28
29 import javax.annotation.Resource;
30 import javax.ejb.EJB JavaDoc;
31 import javax.ejb.Remote JavaDoc;
32 import javax.ejb.SessionContext JavaDoc;
33 import javax.ejb.Stateless JavaDoc;
34
35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfEJBRef;
36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod01;
37
38
39 /**
40  * @author Eduardo Studzinski Estima de Castro
41  * @author Gisele Pinheiro Souza
42  *
43  */

44 @Stateless JavaDoc(name = "SLSBEjbRefFieldInjection")
45 @Remote JavaDoc(ItfEJBRef.class)
46 public class SLSBEjbRefMethodInjection implements ItfEJBRef {
47
48     /**
49      * SessionContext.
50      */

51     @Resource
52     private SessionContext JavaDoc ctx;
53
54     /**
55      * Bean.
56      */

57     private ItfOneMethod01 bean00;
58
59     /**
60      * Bean.
61      */

62     private ItfOneMethod01 bean01;
63
64     /**
65      * Bean.
66      */

67     private ItfOneMethod01 bean02;
68
69     /**
70      * Bean.
71      */

72     private ItfOneMethod01 bean03;
73
74     /**
75      * Bean.
76      */

77     private ItfOneMethod01 bean04;
78
79     /**
80      * Bean.
81      */

82     private ItfOneMethod01 bean05;
83
84     /**
85      * Bean.
86      */

87     private ItfOneMethod01 bean06;
88
89     /**
90      * Setter method.
91      * @param b bean
92      */

93     @EJB JavaDoc
94     public void setBean00(final ItfOneMethod01 b){
95         bean00 = b;
96     }
97
98     /**
99      * Setter method.
100      * @param b bean
101      */

102     @EJB JavaDoc(name = "ejb/bean01", description = "This bean is used to test name and description properties of the @EJB annotation.")
103     public void setBean01(final ItfOneMethod01 b){
104         bean01 = b;
105     }
106
107     /**
108      * Setter method.
109      * @param b bean
110      */

111     @EJB JavaDoc(beanInterface = ItfOneMethod01.class)
112     public void setBean02(final ItfOneMethod01 b){
113         bean02 = b;
114     }
115
116     /**
117      * Setter method.
118      * @param b bean
119      */

120     @EJB JavaDoc(beanName = "EJBInjectionBean")
121     public void setBean03(final ItfOneMethod01 b){
122         bean03 = b;
123     }
124
125     /**
126      * Setter method.
127      * @param b bean
128      */

129     @EJB JavaDoc(mappedName = "org.objectweb.easybeans.tests.common.ejbs.base.EJBInjectionBean_org.objectweb.easybeans.tests.common."
130         + "ejbs.base.ItfOneMethod01@Remote")
131     public void setBean04(final ItfOneMethod01 b){
132         bean04 = b;
133     }
134
135
136     /**
137      * Setter method.
138      * @param b bean
139      */

140     @EJB JavaDoc(name = "ejb/bean05", beanInterface = ItfOneMethod01.class, beanName = "EJBInjectionBean", description = "bean05")
141     public void setBean05(final ItfOneMethod01 b){
142         bean05 = b;
143     }
144
145     /**
146      * Setter method.
147      * @param b bean
148      */

149     @EJB JavaDoc(name = "ejb/bean06", beanInterface = ItfOneMethod01.class, beanName = "EJBInjectionBean", description = "bean06",
150             mappedName = "org.objectweb.easybeans.tests.common.ejbs.base.EJBInjectionBean_org.objectweb.easybeans.tests.common."
151             + "ejbs.base.ItfOneMethod01@Remote")
152     public void setBean06(final ItfOneMethod01 b){
153         bean06 = b;
154     }
155
156     /**
157      * Checks if the annotation @EJB is working properly. The annotation's
158      * properties are not used.
159      */

160     public void check00() {
161         assert bean00.getBool();
162         checkBeanRef(ctx,
163                 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged."
164                 + "ejbref.SLSBEjbRefMethodInjection/bean00", ItfOneMethod01.class);
165     }
166
167     /**
168      * Checks if the annotation @EJB is working properly. The following
169      * properties are used: <li>name</li><li>description</li>
170      */

171     public void check01() {
172         assert bean01.getBool();
173         checkBeanRef(ctx, "ejb/bean01", ItfOneMethod01.class);
174     }
175
176     /**
177      * Checks if the annotation &#64;EJB is working properly. The following
178      * property is used: <li>beanInterface</li>
179      */

180     public void check02() {
181         assert bean02.getBool();
182         checkBeanRef(ctx,
183                 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged."
184                 + "ejbref.SLSBEjbRefMethodInjection/bean02", ItfOneMethod01.class);
185     }
186
187     /**
188      * Checks if the annotation &#64;EJB is working properly. The following
189      * property is used: <li>beanName</li>
190      */

191     public void check03() {
192         assert bean03.getBool();
193         checkBeanRef(ctx,
194                 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged."
195                 + "ejbref.SLSBEjbRefMethodInjection/bean03", ItfOneMethod01.class);
196     }
197
198     /**
199      * Checks if the annotation &#64;EJB is working properly. The following
200      * property is used: <li>mappedName</li>
201      */

202     public void check04() {
203         assert bean04.getBool();
204         checkBeanRef(ctx,
205                 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged."
206                 + "ejbref.SLSBEjbRefMethodInjection/bean04", ItfOneMethod01.class);
207     }
208
209     /**
210      * Checks if the annotation &#64;EJB is working properly. The following
211      * properties are used: <li>name</li> <li>beanInterface</li><li>beanName</li><li>description</li>
212      */

213     public void check05() {
214         assert bean05.getBool();
215         checkBeanRef(ctx, "ejb/bean05", ItfOneMethod01.class);
216     }
217
218     /**
219      * Checks if the annotation &#64;EJB is working properly. The following
220      * properties are used: <li>name</li> <li>beanInterface</li><li>beanName</li><li>description</li><li>mappedName</li>
221      */

222     public void check06() {
223         assert bean06.getBool();
224         checkBeanRef(ctx, "ejb/bean06", ItfOneMethod01.class);
225     }
226 }
227
Popular Tags