KickJava   Java API By Example, From Geeks To Geeks.

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


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: SLSBEjbRefDeclaration.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.EJBs JavaDoc;
32 import javax.ejb.Remote JavaDoc;
33 import javax.ejb.SessionContext JavaDoc;
34 import javax.ejb.Stateless JavaDoc;
35
36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfEJBRef;
37 import org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod01;
38
39
40 /**
41  * This bean is used to test declaration of ejb references using the @EJB annotation.
42  * @author Eduardo Studzinski Estima de Castro
43  * @author Gisele Pinheiro Souza
44  *
45  */

46 @Stateless JavaDoc(name = "SLSBEjbRefDeclaration")
47 @Remote JavaDoc(ItfEJBRef.class)
48 @EJBs JavaDoc({
49     @EJB JavaDoc(name = "ejb/bean00", beanInterface=ItfOneMethod01.class),
50     @EJB JavaDoc(name = "ejb/bean01", beanInterface=ItfOneMethod01.class, mappedName="org.objectweb.easybeans.tests.common.ejbs.base."
51             + "EJBInjectionBean_org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod01@Remote"),
52     @EJB JavaDoc(name = "ejb/bean02", beanInterface = ItfOneMethod01.class, beanName = "EJBInjectionBean", description = "bean02",
53             mappedName = "org.objectweb.easybeans.tests.common.ejbs.base.EJBInjectionBean_org.objectweb.easybeans.tests.common."
54             + "ejbs.base.ItfOneMethod01@Remote"),
55     @EJB JavaDoc(name = "ejb/bean03", beanInterface=ItfEJBRef.class),
56     @EJB JavaDoc(name = "ejb/bean04", beanInterface=ItfEJBRef.class, mappedName="org.objectweb.easybeans.tests.common.ejbs.stateless."
57             + "containermanaged.ejbref.SLSBEjbRefMethodInjection_org.objectweb.easybeans.tests.common."
58             + "ejbs.base.ItfEJBRef@Remote"),
59     @EJB JavaDoc(name = "ejb/bean05", beanInterface = ItfEJBRef.class, beanName = "EJBInjectionBean", description = "bean05",
60             mappedName = "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.ejbref."
61             + "SLSBEjbRefMethodInjection_org.objectweb.easybeans.tests.common.ejbs.base.ItfEJBRef@Remote")
62     })
63 @EJB JavaDoc(name = "ejb/bean06", beanInterface=ItfEJBRef.class, mappedName="org.objectweb.easybeans.tests.common."
64         + "ejbs.stateless.containermanaged.ejbref.SLSBEjbRefMethodInjection_org.objectweb.easybeans.tests."
65         + "common.ejbs.base.ItfEJBRef@Remote")
66 public class SLSBEjbRefDeclaration implements ItfEJBRef{
67
68     /**
69      * SessionContext.
70      */

71     @Resource
72     private SessionContext JavaDoc ctx;
73
74     /**
75      * Checks the EJB reference.
76      */

77     public void check00() {
78         checkBeanRef(ctx, "ejb/bean00", ItfOneMethod01.class);
79     }
80
81     /**
82      * Checks the EJB reference.
83      */

84     public void check01() {
85         checkBeanRef(ctx, "ejb/bean01", ItfOneMethod01.class);
86     }
87
88     /**
89      * Checks the EJB reference.
90      */

91     public void check02() {
92         checkBeanRef(ctx, "ejb/bean02", ItfOneMethod01.class);
93     }
94
95     /**
96      * Checks the EJB reference.
97      */

98     public void check03() {
99         checkBeanRef(ctx, "ejb/bean03", ItfEJBRef.class);
100     }
101
102     /**
103      * Checks the EJB reference.
104      */

105     public void check04() {
106         checkBeanRef(ctx, "ejb/bean04", ItfEJBRef.class);
107     }
108
109     /**
110      * Checks the EJB reference.
111      */

112     public void check05() {
113         checkBeanRef(ctx, "ejb/bean05", ItfEJBRef.class);
114     }
115
116     /**
117      * Checks the EJB reference.
118      */

119     public void check06() {
120         checkBeanRef(ctx, "ejb/bean06", ItfOneMethod01.class);
121     }
122
123 }
124
Popular Tags