01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: BaseInvocationParameter00.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.tests.common.ejbs.base.invocationcontext;
25:
26: import javax.interceptor.Interceptors;
27:
28: import org.ow2.easybeans.tests.common.interceptors.invocationcontext.ComplexObject00;
29: import org.ow2.easybeans.tests.common.interceptors.invocationcontext.ICParamInterceptorCheckNull;
30: import org.ow2.easybeans.tests.common.interceptors.invocationcontext.ICParamInterceptorModifiedParam;
31: import org.ow2.easybeans.tests.common.interceptors.invocationcontext.ICParamInterceptorNewArray;
32: import org.ow2.easybeans.tests.common.interceptors.invocationcontext.ICParamInterceptorNull;
33: import org.ow2.util.log.Log;
34: import org.ow2.util.log.LogFactory;
35:
36: /**
37: * Used to manipulate the invocation context object.
38: * @author Eduardo Studzinski Estima de Castro
39: * @author Gisele Pinheiro Souza
40: */
41: public class BaseInvocationParameter00 implements
42: ItfInvocationParameter00 {
43:
44: /**
45: * Logger.
46: */
47: private Log logger = LogFactory
48: .getLog(BaseInvocationParameter00.class);
49:
50: /**
51: * Returns objects passed as parameters with null references. There are two interceptors
52: * that set to null the parameters reference.
53: * @param objCP complex object
54: * @return array with the objects passed as parameters.
55: * @throws Exception if a problem occurs.
56: */
57: @Interceptors({ICParamInterceptorNull.class,ICParamInterceptorCheckNull.class})
58: public Object[] getObjects00(ComplexObject00 objCP)
59: throws Exception {
60: Object[] arObjs = { objCP };
61: logger.debug("after interceptors, parameters: {0}", objCP);
62: return arObjs;
63: }
64:
65: /**
66: * Returns objects passed as parameters without modification.There are two interceptors
67: * that create a new array to return, but it doesn't modify the objects passed as parameters.
68: * @param objCP complex object
69: * @return array with the objects passed as parameters.
70: * @throws Exception if a problem occurs.
71: */
72: @Interceptors({ICParamInterceptorNewArray.class,ICParamInterceptorNewArray.class})
73: public Object[] getObjects01(ComplexObject00 objCP)
74: throws Exception {
75: Object[] arObjs = { objCP };
76: logger.debug("after interceptors, parameters: {0}, {1}", objCP);
77: return arObjs;
78: }
79:
80: /**
81: * Returns objects passed as parameters with modifications.
82: * There is an interceptor that modifies the parameters.
83: * @param objCP complex object
84: * @return array with the objects passed as parameters.
85: * @throws Exception if a problem occurs.
86: */
87: @Interceptors({ICParamInterceptorModifiedParam.class})
88: public Object[] getObjects02(ComplexObject00 objCP)
89: throws Exception {
90: Object[] arObjs = { objCP };
91: logger.debug("after interceptors, parameters: {0}", objCP);
92: return arObjs;
93: }
94: }
|