KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > base > interceptoraccess > BeanInterceptorAccess00


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: 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>SessionContext
45  * 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 Castro
49  * @author Gisele Pinheiro Souza
50  */

51 @Resource(name="jdbc/jdbc_1", mappedName="jdbc_1", type=javax.sql.DataSource JavaDoc.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 null
59      * @throws Exception if a problem occurs.
60      */

61     @Interceptors({JCompEnvAccess00Interceptor.class})
62     public Object JavaDoc accessJNDI(final Object JavaDoc obj) throws Exception JavaDoc {
63         return null;
64     }
65
66     /**
67      * This has an interceptor that accesses an EJB.
68      * @param obj it's not used.
69      * @return null
70      * @throws Exception if a problem occurs.
71      */

72     @Interceptors({EJBAccess00Interceptor.class})
73     public Object JavaDoc accessEJB(final Object JavaDoc obj) throws Exception JavaDoc {
74         return null;
75     }
76
77     /**
78      * This has an interceptor that accesses a resource.
79      * @param obj it's not used.
80      * @return null
81      * @throws Exception if a problem occurs.
82      */

83     @Interceptors({ResourceAccess00Interceptor.class})
84     public Object JavaDoc accessResManager(final Object JavaDoc obj) throws Exception JavaDoc {
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 null
92      * @throws Exception if a problem occurs.
93      */

94     @Interceptors({EntityManagerAccess00Interceptor.class})
95     public Object JavaDoc accessEntityManager(final Object JavaDoc obj) throws Exception JavaDoc {
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 null
103      * @throws Exception if a problem occurs.
104      */

105     @Interceptors({EMFactoryAccess00Interceptor.class})
106     public Object JavaDoc accessEntityManagerFactory(final Object JavaDoc obj) throws Exception JavaDoc {
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 null
114      * @throws Exception if a problem occurs.
115      */

116     @Interceptors({SessionContextAccess00Interceptor.class})
117     public Object JavaDoc accessSessionContext(final Object JavaDoc obj) throws Exception JavaDoc {
118         return null;
119     }
120
121 }
122
Popular Tags