站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.0.5 API 文档英文版

ThrowsAdviceInterceptor (Spring Framework API 2.0) - Spring Framework 2.0.5 API 文档英文版

The Spring Framework

org.springframework.aop.framework.adapter
Class ThrowsAdviceInterceptor

java.lang.Object
  extended by org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor, AfterAdvice

public class ThrowsAdviceInterceptor
extends Object
implements MethodInterceptor, AfterAdvice

Interceptor to wrap an after-throwing advice.

The signatures on handler methods on the ThrowsAdvice implementation method argument must be of the form:
void afterThrowing([Method, args, target], ThrowableSubclass);

Only the last argument is required.

Some examples of valid methods would be:

public void afterThrowing(Exception ex)
public void afterThrowing(RemoteException)
public void afterThrowing(Method method, Object[] args, Object target, Exception ex)
public void afterThrowing(Method method, Object[] args, Object target, ServletException ex)

This is a framework class that need not be used directly by Spring users.

Author:
Rod Johnson, Juergen Hoeller

Constructor Summary
ThrowsAdviceInterceptor(Object throwsAdvice)
          Create a new ThrowsAdviceInterceptor for the given ThrowsAdvice.
 
Method Summary
 int getHandlerMethodCount()
           
 Object invoke(MethodInvocation mi)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThrowsAdviceInterceptor

public ThrowsAdviceInterceptor(Object throwsAdvice)
Create a new ThrowsAdviceInterceptor for the given ThrowsAdvice.

Parameters:
throwsAdvice - the advice object that defines the exception handler methods (usually a ThrowsAdvice implementation)
Method Detail

getHandlerMethodCount

public int getHandlerMethodCount()

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable

The Spring Framework

Copyright © 2002-2007 The Spring Framework.