1 /**2 * EasyBeans3 * Copyright (C) 2006 Bull S.A.S.4 * Contact: easybeans@objectweb.org5 *6 * This library is free software; you can redistribute it and/or7 * modify it under the terms of the GNU Lesser General Public8 * License as published by the Free Software Foundation; either9 * 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 of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14 * Lesser General Public License for more details.15 *16 * You should have received a copy of the GNU Lesser General Public17 * License along with this library; if not, write to the Free Software18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-130719 * USA20 *21 * --------------------------------------------------------------------------22 * $Id: BeanInterceptorAccess00.java 821 2006-07-04 13:28:52Z studzine $23 * --------------------------------------------------------------------------24 */25 package org.objectweb.easybeans.tests.common.ejbs.base.interceptoraccess;26 27 import javax.annotation.Resource;28 import javax.interceptor.Interceptors;29 30 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEJB;31 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEMFactory;32 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEntityManager;33 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessJNDI;34 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessResourceManager;35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessSessionContext;36 import org.objectweb.easybeans.tests.common.interceptors.business.access.EJBAccess00Interceptor;37 import org.objectweb.easybeans.tests.common.interceptors.business.access.EMFactoryAccess00Interceptor;38 import org.objectweb.easybeans.tests.common.interceptors.business.access.EntityManagerAccess00Interceptor;39 import org.objectweb.easybeans.tests.common.interceptors.business.access.JCompEnvAccess00Interceptor;40 import org.objectweb.easybeans.tests.common.interceptors.business.access.ResourceAccess00Interceptor;41 import org.objectweb.easybeans.tests.common.interceptors.business.access.SessionContextAccess00Interceptor;42 43 /**44 * Used to test the interceptors access to the following resources.<br> <li>SessionContext45 * Methods</li> <li>JNDI Access to java:comp/env</li> <li>Resource Manager</li>46 * <li>Enterprise bean</li> <li>EntityManagerFactory</li> <li>EntityManager</li>47 * <li>UserTransaction</li>48 * @author Eduardo Studzinski Estima de Castro49 * @author Gisele Pinheiro Souza50 */51 @Resource(name="jdbc/jdbc_1", mappedName="jdbc_1", type=javax.sql.DataSource .class)52 public class BeanInterceptorAccess00 implements ItfAccessJNDI, ItfAccessEJB, ItfAccessResourceManager,53 ItfAccessEntityManager, ItfAccessEMFactory, ItfAccessSessionContext {54 55 /**56 * This has an interceptor that accesses the java:comp/env via JNDI.57 * @param obj it's not used.58 * @return null59 * @throws Exception if a problem occurs.60 */61 @Interceptors({JCompEnvAccess00Interceptor.class})62 public Object accessJNDI(final Object obj) throws Exception {63 return null;64 }65 66 /**67 * This has an interceptor that accesses an EJB.68 * @param obj it's not used.69 * @return null70 * @throws Exception if a problem occurs.71 */72 @Interceptors({EJBAccess00Interceptor.class})73 public Object accessEJB(final Object obj) throws Exception {74 return null;75 }76 77 /**78 * This has an interceptor that accesses a resource.79 * @param obj it's not used.80 * @return null81 * @throws Exception if a problem occurs.82 */83 @Interceptors({ResourceAccess00Interceptor.class})84 public Object accessResManager(final Object obj) throws Exception {85 return null;86 }87 88 /**89 * This has an interceptor that accesses an entity manager.90 * @param obj it's not used.91 * @return null92 * @throws Exception if a problem occurs.93 */94 @Interceptors({EntityManagerAccess00Interceptor.class})95 public Object accessEntityManager(final Object obj) throws Exception {96 return null;97 }98 99 /**100 * This has an interceptor that accesses an entity manager.101 * @param obj it's not used.102 * @return null103 * @throws Exception if a problem occurs.104 */105 @Interceptors({EMFactoryAccess00Interceptor.class})106 public Object accessEntityManagerFactory(final Object obj) throws Exception {107 return null;108 }109 110 /**111 * This has an interceptor that accesses the sessionContext and tries to lookup a datasource.112 * @param obj it's not used.113 * @return null114 * @throws Exception if a problem occurs.115 */116 @Interceptors({SessionContextAccess00Interceptor.class})117 public Object accessSessionContext(final Object obj) throws Exception {118 return null;119 }120 121 }122