KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > enhancer > interceptors > business > bean > StatelessLocalItf


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: StatelessLocalItf.java 54 2006-02-28 15:26:55Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.tests.enhancer.interceptors.business.bean;
27
28
29 /**
30  * Local interface.
31  * @author Florent Benoit
32  */

33 public interface StatelessLocalItf {
34
35     // =====================
36
// boolean
37
// =====================
38

39     /**
40      * Test method on boolean.
41      * @param b value to return
42      * @return given value
43      */

44     boolean getBoolean(final boolean b);
45
46     /**
47      * Test method on boolean.
48      * @param booleans array to return
49      * @return given value
50      */

51     boolean[] getBooleans(final boolean[] booleans);
52
53     // =====================
54
// byte
55
// =====================
56

57     /**
58      * Test method on byte.
59      * @param i value to return
60      * @return given value
61      */

62     byte getByte(final byte i);
63
64     /**
65      * Test method on byte.
66      * @param bytes array to return
67      * @return given value
68      */

69     byte[] getBytes(final byte[] bytes);
70
71     // =====================
72
// char
73
// =====================
74

75
76     /**
77      * Test method on char.
78      * @param c value to return
79      * @return given value
80      */

81     char getChar(final char c);
82
83     /**
84      * Test method on char.
85      * @param chars array to return
86      * @return given value
87      */

88     char[] getChars(final char[] chars);
89
90     // =====================
91
// double
92
// =====================
93

94
95     /**
96      * Test method on double.
97      * @param d value to return
98      * @return given value
99      */

100     double getDouble(final double d);
101
102     /**
103      * Test method on double.
104      * @param doubles array to return
105      * @return given value
106      */

107     double[] getDoubles(final double[] doubles);
108
109     // =====================
110
// float
111
// =====================
112

113
114     /**
115      * Test method on float.
116      * @param f value to return
117      * @return given value
118      */

119     float getFloat(final float f);
120
121     /**
122      * Test method on float.
123      * @param floats array to return
124      * @return given value
125      */

126     float[] getFloats(final float[] floats);
127
128     // =====================
129
// int
130
// =====================
131

132
133     /**
134      * Test method on int.
135      * @param i value to return
136      * @return given value
137      */

138     int getInt(final int i);
139
140     /**
141      * Adds two int.
142      * @param i first value
143      * @param j second value
144      * @return given value
145      */

146     int addInt(final int i, final int j);
147
148     /**
149      * Test method on int.
150      * @param ints array to return
151      * @return given value
152      */

153     int[] getInts(final int[] ints);
154
155
156     // =====================
157
// long
158
// =====================
159

160     /**
161      * Test method on long.
162      * @param l value to return
163      * @return given value
164      */

165     long getLong(final long l);
166
167     /**
168      * Test method on long.
169      * @param longs array to return
170      * @return given value
171      */

172     long[] getLongs(final long[] longs);
173
174     // =====================
175
// short
176
// =====================
177

178
179     /**
180      * Test method on short.
181      * @param s value to return
182      * @return given value
183      */

184     short getShort(final short s);
185
186     /**
187      * Test method on short.
188      * @param shorts array to return
189      * @return given value
190      */

191     short[] getShorts(final short[] shorts);
192
193
194     // =====================
195
// Mix of primitives
196
// =====================
197

198
199     /**
200      * Test method on primitive.
201      * @param flag value to return
202      * @param b value to return
203      * @param c value to return
204      * @param d value to return
205      * @param f value to return
206      * @param i value to return
207      * @param l value to return
208      * @param o value to return
209      * @return given values
210      */

211     Object JavaDoc[] getPrimitive(final boolean flag, final byte b, final char c, final double d, final float f, final int i,
212             final long l, final Object JavaDoc o);
213
214
215     // =====================
216
// Exceptions
217
// =====================
218

219
220     /**
221      * Throws a user defined exception.
222      * @throws TestException an user defined exception
223      */

224     void someCustomizedExceptions() throws TestException;
225
226     /**
227      * Throws user defined exceptions.
228      * @param value depending of the value, throw different exceptions.
229      * @throws TestException an user defined exception
230      * @throws TestException2 another user defined exception
231      */

232     void someCustomizedExceptions2(final int value) throws TestException, TestException2;
233
234     /**
235      * Throws user defined exceptions.
236      * @param value depending of the value, throw different exceptions
237      * @throws Exception another exception
238      */

239     void someCustomizedExceptions3(final int value) throws Exception JavaDoc;
240
241     /**
242      * Method do nothing but the interceptor will throw an exception.
243      */

244     void throwExceptionByInterceptor();
245
246
247     /**
248      * Change the return value by the interceptor.
249      * @param i value to be add twice.
250      * @return a value (mult * 2) of the given value
251      */

252     int valueDoubledByInterceptor(int i);
253
254     /**
255      * Test interceptor which is applied only on a single method.
256      */

257     void singleMethodIntercepted();
258
259     /**
260      * Test that no interceptors are called on this method.
261      */

262     void excludedInterceptorsMethod();
263
264     /**
265      * Two methods with the same name but different parameters.
266      * First method.
267      * @param i dummy parameter.
268      */

269     void sameMethodName(int i);
270
271     /**
272      * Two methods with the same name but different parameters.
273      * Second method.
274      * @param d dummy parameter.
275      */

276     void sameMethodName(double d);
277
278
279 }
280
Popular Tags