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