org.codehaus.waffle.action.intercept
Interface MethodInterceptor

All Known Implementing Classes:
SecurityMethodInterceptor

public interface MethodInterceptor

A MethodInterceptor is a simple interface that allows you to intercept ActionMethods before and after they have been invoked. This before and after interception provides AOP type of functionality.


Method Summary
 boolean accept(java.lang.reflect.Method method)
          Determines if the implementation should intercept the call to the Action Method.
 java.lang.Object intercept(ControllerDefinition controllerDefinition, java.lang.reflect.Method method, InterceptorChain chain, java.lang.Object... arguments)
          This method allows an ActionMethod call to be intercepted.
 

Method Detail

accept

boolean accept(java.lang.reflect.Method method)
Determines if the implementation should intercept the call to the Action Method.

Parameters:
method - is the action method that is to be invoked (or intercepted)
Returns:
true if this should intercept the invocation

intercept

java.lang.Object intercept(ControllerDefinition controllerDefinition,
                           java.lang.reflect.Method method,
                           InterceptorChain chain,
                           java.lang.Object... arguments)
                           throws java.lang.IllegalAccessException,
                                  java.lang.reflect.InvocationTargetException
This method allows an ActionMethod call to be intercepted. To continue onto the next MethodInterceptor, or ActionMethod, the implementation should call InterceptorChain.proceed(ControllerDefinition, Method, Object[]).

Parameters:
controllerDefinition - the controller definition instance which owns the action method being invoked
method - the actual action method to be invoked
chain - is the InterceptorChain managing the method interceptors
arguments - are the argument values to satisfy the action method invocation
Returns:
the result from the action method's invocation, or result from this or another MethodInterceptor
Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException


Copyright © 2008. All Rights Reserved.