KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > stateless > containermanaged > simpleentry > SLSBSimpleEnvEntryMethodInjection00


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: SLSBSimpleEnvEntryMethodInjection00.java 547 2006-05-30 13:50:43Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.simpleentry;
26
27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkSimpleEntry;
28
29 import javax.annotation.Resource;
30 import javax.ejb.Remote JavaDoc;
31 import javax.ejb.SessionContext JavaDoc;
32 import javax.ejb.Stateless JavaDoc;
33
34 import org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry;
35
36 /**
37  * This bean is used to test injection of simple environment entries in set methods.
38  * @author Eduardo Studzinski Estima de Castro
39  * @author Gisele Pinheiro Souza
40  */

41 @Stateless JavaDoc(name="SLSBSimpleEnvEntryMethodInjection00")
42 @Remote JavaDoc(ItfSimpleEnvEntry.class)
43 public class SLSBSimpleEnvEntryMethodInjection00 implements ItfSimpleEnvEntry {
44
45     /**
46      * SessionContext.
47      */

48     @Resource
49     private SessionContext JavaDoc sessionContext;
50
51     /**
52      * Property inicialized by an injection.
53      */

54     private String JavaDoc strInjection;
55
56     /**
57      * Property inicialized by an injection.
58      */

59     private char chrInjection;
60
61     /**
62      * Property inicialized by an injection.
63      */

64     private int intInjection;
65
66     /**
67      * Property inicialized by an injection.
68      */

69     private boolean bolInjection;
70
71     /**
72      * Property inicialized by an injection.
73      */

74     private double dblInjection;
75
76     /**
77      * Property inicialized by an injection.
78      */

79     private byte bteInjection;
80
81     /**
82      * Property inicialized by an injection.
83      */

84     private short shrInjection;
85
86     /**
87      * Property inicialized by an injection.
88      */

89     private long lngInjection;
90
91     /**
92      * Property inicialized by an injection.
93      */

94     private float fltInjection;
95
96     /**
97      * The default value must be injected by the container.
98      * @param value information value
99      */

100     @Resource(name = "str00")
101     public void setStrInjection(final String JavaDoc value){
102         strInjection = value;
103     }
104
105     /**
106      * The default value must be injected by the container.
107      * @param value information value
108      */

109     @SuppressWarnings JavaDoc("unused")
110     @Resource(name = "chr00")
111     private void setChrInjection(final char value){
112         chrInjection = value;
113     }
114
115     /**
116      * The default value must be injected by the container.
117      * @param value information value
118      */

119     @Resource(name = "int00")
120     protected void setIntInjection(final int value){
121         intInjection = value;
122     }
123
124     /**
125      * The default value must be injected by the container.
126      * @param value information value
127      */

128     @Resource(name = "bol00")
129     void setBolInjection(final boolean value){
130         bolInjection = value;
131     }
132
133     /**
134      * The default value must be injected by the container.
135      * @param value information value
136      */

137     @Resource(name = "dbl00")
138     public void setDblInjection(final double value){
139         dblInjection = value;
140     }
141
142     /**
143      * The default value must be injected by the container.
144      * @param value information value
145      */

146     @Resource(name = "bte00")
147     public void setBteInjection(final byte value){
148         bteInjection = value;
149     }
150
151     /**
152      * The default value must be injected by the container.
153      * @param value information value
154      */

155     @Resource(name = "shr00")
156     public void setShrInjection(final short value){
157         shrInjection = value;
158     }
159
160     /**
161      * The default value must be injected by the container.
162      * @param value information value
163      */

164     @Resource(name = "lng00")
165     public void setLngInjection(final long value){
166         lngInjection = value;
167     }
168
169     /**
170      * The default value must be injected by the container. The name must be generated by the container: class name/field name.
171      * @param value information value
172      */

173     @Resource
174     public void setFltInjection(final float value){
175         fltInjection = value;
176     }
177
178     /**
179      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
180      */

181     public void checkString00() {
182         checkSimpleEntry(sessionContext, "str00", strInjection, ENTRY_STRING);
183     }
184
185     /**
186      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
187      */

188     @SuppressWarnings JavaDoc("boxing")
189     public void checkCharacter00() {
190         checkSimpleEntry(sessionContext, "chr00", chrInjection, ENTRY_CHARACTER);
191     }
192
193     /**
194      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
195      */

196     @SuppressWarnings JavaDoc("boxing")
197     public void checkInteger00() {
198         checkSimpleEntry(sessionContext, "int00", intInjection, ENTRY_INTEGER);
199     }
200
201     /**
202      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
203      */

204     @SuppressWarnings JavaDoc("boxing")
205     public void checkBoolean00() {
206         checkSimpleEntry(sessionContext, "bol00", bolInjection, ENTRY_BOOLEAN);
207     }
208
209     /**
210      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
211      */

212     @SuppressWarnings JavaDoc("boxing")
213     public void checkDouble00() {
214         checkSimpleEntry(sessionContext, "dbl00", dblInjection, ENTRY_DOUBLE);
215     }
216
217     /**
218      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
219      */

220     @SuppressWarnings JavaDoc("boxing")
221     public void checkByte00() {
222         checkSimpleEntry(sessionContext, "bte00", bteInjection, ENTRY_BYTE);
223     }
224
225     /**
226      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
227      */

228     @SuppressWarnings JavaDoc("boxing")
229     public void checkShort00() {
230         checkSimpleEntry(sessionContext, "shr00", shrInjection, ENTRY_SHORT);
231     }
232
233     /**
234      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
235      */

236     @SuppressWarnings JavaDoc("boxing")
237     public void checkLong00() {
238         checkSimpleEntry(sessionContext, "lng00", lngInjection, ENTRY_LONG);
239     }
240
241     /**
242      * @see org.objectweb.easybeans.tests.common.ejbs.base.ItfSimpleEnvEntry
243      */

244     @SuppressWarnings JavaDoc("boxing")
245     public void checkFloat00() {
246         checkSimpleEntry(sessionContext, this.getClass().getName().toString()+"/"+ "fltInjection", fltInjection, ENTRY_FLOAT);
247     }
248 }
249
Popular Tags