org.equilibriums.aop.utils.interceptor.stub
Class StubWithThrowableInterceptor

java.lang.Object
  extended by org.equilibriums.aop.utils.interceptor.stub.StubWithThrowableInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class StubWithThrowableInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor

Throws specified exception for the method this interceptor is configured for without calling target method (wont call invocation.proceed() ).

IllegalArgumentException is thrown when specified exception is not a RuntimeException and is not part of method declared checked exceptions or if method has no declared checked exceptions.

For more on how to use this interceptor see Overview section of this Javadoc.

Author:
Tsolak Petrosian

Constructor Summary
StubWithThrowableInterceptor()
           
 
Method Summary
 Throwable getThrowable()
           
 Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
           
 void setThrowable(Throwable throwable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StubWithThrowableInterceptor

public StubWithThrowableInterceptor()
Method Detail

getThrowable

public Throwable getThrowable()

setThrowable

public void setThrowable(Throwable throwable)

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable


Copyright © 2011. All Rights Reserved.