KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > stateless > containermanaged > invocationcontext > SLSBInvocationContext02


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: SLSBInvocationContext02.java 880 2006-07-17 11:51:17Z studzine $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.invocationcontext;
26
27 import javax.ejb.Remote JavaDoc;
28 import javax.ejb.Stateless JavaDoc;
29 import javax.interceptor.AroundInvoke;
30 import javax.interceptor.Interceptors;
31 import javax.interceptor.InvocationContext;
32
33 import org.objectweb.easybeans.tests.common.ejbs.base.invocationcontext.ItfInvocationParameter01;
34 import org.objectweb.easybeans.tests.common.helper.InvocationContextHelper;
35 import org.objectweb.easybeans.tests.common.interceptors.invocationcontext.BeanDescriptor;
36 import org.objectweb.easybeans.tests.common.interceptors.invocationcontext.ComplexObject00;
37 import org.objectweb.easybeans.tests.common.interceptors.invocationcontext.ICDataAddInterceptor;
38 import org.objectweb.easybeans.tests.common.interceptors.invocationcontext.ICDataCheckEmptyInterceptor;
39 import org.objectweb.easybeans.tests.common.interceptors.invocationcontext.ICDataClearInterceptor;
40
41 /**
42  * This bean is used to manipulate the invocation context object.
43  * @author Eduardo Studzinski E. de Castro
44  * @author Gisele Pinheiro Souza
45  */

46 @Stateless JavaDoc
47 @Remote JavaDoc
48 @Interceptors({ICDataAddInterceptor.class, ICDataClearInterceptor.class, ICDataCheckEmptyInterceptor.class})
49 public class SLSBInvocationContext02 implements ItfInvocationParameter01 {
50
51     /**
52      * Returns objects passed as parameters.
53      * @param objCP complex object
54      * @param beanDescriptor a bean descriptor
55      * @return null
56      * @throws Exception if a problem occurs.
57      */

58     @Interceptors({ICDataCheckEmptyInterceptor.class, ICDataAddInterceptor.class, ICDataClearInterceptor.class,
59             ICDataCheckEmptyInterceptor.class, ICDataAddInterceptor.class, ICDataClearInterceptor.class})
60     public Object JavaDoc[] getObjects(final ComplexObject00 objCP, final BeanDescriptor beanDescriptor) throws Exception JavaDoc {
61         return null;
62     }
63
64     /**
65      * Interceptor that checks the invocation context object.
66      * @param ic contains attributes of invocation
67      * @return method's invocation result
68      * @throws Exception if invocation fails
69      */

70     @AroundInvoke
71     public Object JavaDoc intercept(final InvocationContext ic) throws Exception JavaDoc {
72         return InvocationContextHelper.isEmptyContextData(ic);
73     }
74 }
75
Popular Tags