001/*
002 * Copyright 2002-2008 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.aop;
018
019/**
020 * Tag interface for throws advice.
021 *
022 * <p>There are not any methods on this interface, as methods are invoked by
023 * reflection. Implementing classes must implement methods of the form:
024 *
025 * <pre class="code">void afterThrowing([Method, args, target], ThrowableSubclass);</pre>
026 *
027 * <p>Some examples of valid methods would be:
028 *
029 * <pre class="code">public void afterThrowing(Exception ex)</pre>
030 * <pre class="code">public void afterThrowing(RemoteException)</pre>
031 * <pre class="code">public void afterThrowing(Method method, Object[] args, Object target, Exception ex)</pre>
032 * <pre class="code">public void afterThrowing(Method method, Object[] args, Object target, ServletException ex)</pre>
033 *
034 * The first three arguments are optional, and only useful if we want further
035 * information about the joinpoint, as in AspectJ <b>after-throwing</b> advice.
036 *
037 * <p><b>Note:</b> If a throws-advice method throws an exception itself, it will
038 * override the original exception (i.e. change the exception thrown to the user).
039 * The overriding exception will typically be a RuntimeException; this is compatible
040 * with any method signature. However, if a throws-advice method throws a checked
041 * exception, it will have to match the declared exceptions of the target method
042 * and is hence to some degree coupled to specific target method signatures.
043 * <b>Do not throw an undeclared checked exception that is incompatible with
044 * the target method's signature!</b>
045 *
046 * @author Rod Johnson
047 * @author Juergen Hoeller
048 * @see AfterReturningAdvice
049 * @see MethodBeforeAdvice
050 */
051public interface ThrowsAdvice extends AfterAdvice {
052
053}