KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > stateless > containermanaged > resourceref > SLSBResourceRefXMLInjection00


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: SLSBResourceRefXMLInjection00.java 990 2006-07-31 13:09:09Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.resourceref;
26
27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkResource;
28
29 import java.net.URL JavaDoc;
30
31 import javax.annotation.Resource;
32 import javax.ejb.EJBContext JavaDoc;
33 import javax.ejb.Remote JavaDoc;
34 import javax.ejb.SessionContext JavaDoc;
35 import javax.ejb.Stateless JavaDoc;
36 import javax.jms.ConnectionFactory JavaDoc;
37 import javax.jms.Queue JavaDoc;
38 import javax.jms.QueueConnectionFactory JavaDoc;
39 import javax.jms.Topic JavaDoc;
40 import javax.jms.TopicConnectionFactory JavaDoc;
41 import javax.mail.Session JavaDoc;
42 import javax.sql.DataSource JavaDoc;
43
44 import org.objectweb.easybeans.tests.common.ejbs.base.ItfResourceEnvRef00;
45
46 /**
47  * This bean is used to test injection of resource references by xml descriptors with the injection-target tag.
48  * @author Eduardo Studzinski Estima de Castro
49  * @author Gisele Pinheiro Souza
50  */

51 @Stateless JavaDoc(name = "SLSBResourceRefXMLInjection00")
52 @Remote JavaDoc(ItfResourceEnvRef00.class)
53 public class SLSBResourceRefXMLInjection00 implements ItfResourceEnvRef00 {
54
55     /**
56      * SessionContext.
57      */

58     @Resource
59     private SessionContext JavaDoc sessionContext;
60
61     /**
62      * The reference must be injected by the container using
63      * injection-target(XML).
64      */

65     private DataSource JavaDoc ds00;
66
67     /**
68      * The reference must be injected by the container using
69      * injection-target(XML).
70      */

71     private ConnectionFactory JavaDoc cf00;
72
73     /**
74      * The reference must be injected by the container using
75      * injection-target(XML).
76      */

77     private QueueConnectionFactory JavaDoc qcf00;
78
79     /**
80      * The reference must be injected by the container using
81      * injection-target(XML).
82      */

83     private TopicConnectionFactory JavaDoc tcf00;
84
85     /**
86      * The reference must be injected by the container using
87      * injection-target(XML).
88      */

89     private Queue JavaDoc queue00;
90
91     /**
92      * The reference must be injected by the container using
93      * injection-target(XML).
94      */

95     private Topic JavaDoc topic00;
96
97     /**
98      * The reference must be injected by the container using
99      * injection-target(XML).
100      */

101     private Session JavaDoc mail00;
102
103     /**
104      * The reference must be injected by the container using
105      * injection-target(XML).
106      */

107     private URL JavaDoc url00;
108
109     /**
110      * The reference must be injected by the container using
111      * injection-target(XML).
112      */

113     private EJBContext JavaDoc ctx00;
114
115     /**
116      * Checks the ejb context reference injected by xml descriptor.
117      */

118     public void checkJDBC() {
119         checkResource(sessionContext, ds00, "jdbc/ds00");
120     }
121
122     /**
123      * Checks the ejb context reference injected by xml descriptor.
124      */

125     public void checkJMSConFactory() {
126         checkResource(sessionContext, cf00, "jms/cf00");
127
128     }
129
130     /**
131      * Checks the ejb context reference injected by xml descriptor.
132      */

133     public void checkJMSQueueConFactory() {
134         checkResource(sessionContext, qcf00, "jms/qcf00");
135     }
136
137     /**
138      * Checks the ejb context reference injected by xml descriptor.
139      */

140     public void checkJMSTopicConFactory() {
141         checkResource(sessionContext, tcf00, "jms/tcf00");
142     }
143
144     /**
145      * Checks the ejb context reference injected by xml descriptor.
146      */

147     public void checkMailSession() {
148         checkResource(sessionContext, mail00, "mail/mail00");
149     }
150
151     /**
152      * Checks the ejb context reference injected by xml descriptor.
153      */

154     public void checkUrl() {
155         checkResource(sessionContext, url00, "url/url00");
156     }
157
158     /**
159      * Checks the ejb context reference injected by xml descriptor.
160      */

161     public void checkEJBContext() {
162         checkResource(sessionContext, ctx00, "ejbctx/ctx00");
163     }
164
165     /**
166      * Checks the ejb context reference injected by xml descriptor.
167      */

168     public void checkJMSQueue() {
169         checkResource(sessionContext, queue00, "jms/queue00");
170     }
171
172     /**
173      * Checks the ejb context reference injected by xml descriptor.
174      */

175     public void checkJMSTopic() {
176         checkResource(sessionContext, topic00, "jms/topic00");
177     }
178
179 }
180
Popular Tags