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: InterceptorExceptions00.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.tests.common.ejbs.base.interceptorexception;
25:
26: import javax.interceptor.Interceptors;
27:
28: import org.ow2.easybeans.tests.common.ejbs.base.ItfExceptions;
29: import org.ow2.easybeans.tests.common.exception.CustomException00;
30: import org.ow2.easybeans.tests.common.exception.CustomException01;
31: import org.ow2.easybeans.tests.common.interceptors.business.exception.CausesException00Interceptor;
32: import org.ow2.easybeans.tests.common.interceptors.business.exception.CausesException01Interceptor;
33:
34: /**
35: * Used to test interceptors exceptions.
36: * @author Eduardo Studzinski Estima de Castro
37: * @author Gisele Pinheiro Souza
38: *
39: */
40: public class InterceptorExceptions00 implements ItfExceptions {
41:
42: /**
43: * Gets an integer.
44: * @return value.
45: */
46: public Integer getInt() {
47: return VALUE;
48: }
49:
50: /**
51: * This method should throw CustomException00 exception,
52: * because the interceptor used always throws this exception.
53: * @throws CustomException00 interceptor exception
54: * @return integer
55: */
56: @Interceptors({CausesException00Interceptor.class})
57: public Integer throwsOneException00() throws CustomException00 {
58: return VALUE;
59: }
60:
61: /**
62: * This method should throw CustomException01 exception,
63: * because the interceptor used always throws this exception.
64: * @throws CustomException01 interceptor exception
65: * @return integer
66: */
67: @Interceptors({CausesException01Interceptor.class})
68: public Integer throwsOneException01() throws CustomException01 {
69: return VALUE;
70: }
71:
72: /**
73: * This method should throw CustomException00 exception, because the first
74: * interceptor will be called before the other.
75: * @throws CustomException00 interceptor exception
76: * @throws CustomException01 interceptor exception
77: * @return integer
78: */
79: @Interceptors({CausesException00Interceptor.class,CausesException01Interceptor.class})
80: public Integer throwsTwoExceptions() throws CustomException00,
81: CustomException01 {
82: return VALUE;
83: }
84:
85: }
|