001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: SLSBEjbRefDeclaration.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.ejbref;
025:
026: import static org.ow2.easybeans.tests.common.helper.ContextHelper.checkBeanRef;
027:
028: import javax.annotation.Resource;
029: import javax.ejb.EJB;
030: import javax.ejb.EJBs;
031: import javax.ejb.Remote;
032: import javax.ejb.SessionContext;
033: import javax.ejb.Stateless;
034:
035: import org.ow2.easybeans.tests.common.ejbs.base.ItfEJBRef;
036: import org.ow2.easybeans.tests.common.ejbs.base.ItfOneMethod01;
037:
038: /**
039: * This bean is used to test declaration of ejb references using the @EJB annotation.
040: * @author Eduardo Studzinski Estima de Castro
041: * @author Gisele Pinheiro Souza
042: *
043: */
044: @Stateless(name="SLSBEjbRefDeclaration")
045: @Remote(ItfEJBRef.class)
046: @EJBs({@EJB(name="ejb/bean00",beanInterface=ItfOneMethod01.class),@EJB(name="ejb/bean01",beanInterface=ItfOneMethod01.class,mappedName="org.ow2.easybeans.tests.common.ejbs.base." + "EJBInjectionBean_org.ow2.easybeans.tests.common.ejbs.base.ItfOneMethod01@Remote"),@EJB(name="ejb/bean02",beanInterface=ItfOneMethod01.class,beanName="EJBInjectionBean",description="bean02",mappedName="org.ow2.easybeans.tests.common.ejbs.base.EJBInjectionBean_org.ow2.easybeans.tests.common." + "ejbs.base.ItfOneMethod01@Remote"),@EJB(name="ejb/bean03",beanInterface=ItfEJBRef.class),@EJB(name="ejb/bean04",beanInterface=ItfEJBRef.class,mappedName="org.ow2.easybeans.tests.common.ejbs.stateless." + "containermanaged.ejbref.SLSBEjbRefMethodInjection_org.ow2.easybeans.tests.common." + "ejbs.base.ItfEJBRef@Remote"),@EJB(name="ejb/bean05",beanInterface=ItfEJBRef.class,beanName="EJBInjectionBean",description="bean05",mappedName="org.ow2.easybeans.tests.common.ejbs.stateless.containermanaged.ejbref." + "SLSBEjbRefMethodInjection_org.ow2.easybeans.tests.common.ejbs.base.ItfEJBRef@Remote")})
047: @EJB(name="ejb/bean06",beanInterface=ItfEJBRef.class,mappedName="org.ow2.easybeans.tests.common." + "ejbs.stateless.containermanaged.ejbref.SLSBEjbRefMethodInjection_org.ow2.easybeans.tests." + "common.ejbs.base.ItfEJBRef@Remote")
048: public class SLSBEjbRefDeclaration implements ItfEJBRef {
049:
050: /**
051: * SessionContext.
052: */
053: @Resource
054: private SessionContext ctx;
055:
056: /**
057: * Checks the EJB reference.
058: */
059: public void check00() {
060: checkBeanRef(ctx, "ejb/bean00", ItfOneMethod01.class);
061: }
062:
063: /**
064: * Checks the EJB reference.
065: */
066: public void check01() {
067: checkBeanRef(ctx, "ejb/bean01", ItfOneMethod01.class);
068: }
069:
070: /**
071: * Checks the EJB reference.
072: */
073: public void check02() {
074: checkBeanRef(ctx, "ejb/bean02", ItfOneMethod01.class);
075: }
076:
077: /**
078: * Checks the EJB reference.
079: */
080: public void check03() {
081: checkBeanRef(ctx, "ejb/bean03", ItfEJBRef.class);
082: }
083:
084: /**
085: * Checks the EJB reference.
086: */
087: public void check04() {
088: checkBeanRef(ctx, "ejb/bean04", ItfEJBRef.class);
089: }
090:
091: /**
092: * Checks the EJB reference.
093: */
094: public void check05() {
095: checkBeanRef(ctx, "ejb/bean05", ItfEJBRef.class);
096: }
097:
098: /**
099: * Checks the EJB reference.
100: */
101: public void check06() {
102: checkBeanRef(ctx, "ejb/bean06", ItfOneMethod01.class);
103: }
104:
105: }
|