org.skife.intercept
Interface Interceptor

All Known Implementing Classes:
BlockingInterceptor, InefficientLoggingInterceptor, SecurityInterceptor, TransactionInterceptor

public interface Interceptor

Define an interceptor on method calls.


Method Summary
 java.lang.Object intercept(java.lang.Object base, java.lang.reflect.Method method, java.lang.Object[] args, org.skife.intercept.InterceptorStack stack)
          To pass execution down the stack call one of the stack.yield() methods The return value from this will be whatever the downstream return value was.
 

Method Detail

intercept

public java.lang.Object intercept(java.lang.Object base,
                                  java.lang.reflect.Method method,
                                  java.lang.Object[] args,
                                  org.skife.intercept.InterceptorStack stack)
                           throws java.lang.Throwable
To pass execution down the stack call one of the stack.yield() methods The return value from this will be whatever the downstream return value was. In most cases it is appropriate to return this value.

All interceptors provide "around" style interception with logic before the stack.yield(...) being before downstream invocation, and logic afterwards being after invocation.

Parameters:
base - A reference to the base object being intercepted
method - A reference to the Method being intercepted
args - The invocation arguments
stack - The InterceptorStack
Returns:
a value to be returned by the method invocation
java.lang.Throwable