com.opensymphony.xwork.interceptor
Class MethodFilterInterceptor

java.lang.Object
  extended by com.opensymphony.xwork.interceptor.MethodFilterInterceptor
All Implemented Interfaces:
Interceptor, Serializable
Direct Known Subclasses:
DefaultWorkflowInterceptor, ValidationInterceptor

public abstract class MethodFilterInterceptor
extends Object
implements Interceptor

An abstract Interceptor that is applied to selectively according to specified included/excluded method lists.

Setable parameters are as follows:

NOTE: If method name are available in both includeMethods and excludeMethods, it will still be considered as an included method. In short includeMethods takes precedence over excludeMethods.

Interceptors that extends this capability would be :-

Version:
$Date: 2006-05-15 09:42:45 +0200 (Mon, 15 May 2006) $ $Id: MethodFilterInterceptor.java 1017 2006-05-15 09:42:45 +0200 (Mon, 15 May 2006) tmjee $
Author:
Alexandru Popescu, Rainer Hermanns
See Also:
com.opensymphony.webwork.interceptor.TokenInterceptor, com.opensymphony.webwork.interceptor.TokenSessionStoreInterceptor, DefaultWorkflowInterceptor, ValidationInterceptor, Serialized Form

Field Summary
protected  Set excludeMethods
           
protected  Set includeMethods
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
MethodFilterInterceptor()
           
 
Method Summary
protected  boolean applyInterceptor(ActionInvocation invocation)
           
 void destroy()
          Called to let an interceptor clean up any resources it has allocated.
protected abstract  String doIntercept(ActionInvocation invocation)
          Subclasses must override to implement the interceptor logic.
 Set getExcludeMethodsSet()
           
 Set getIncludeMethodsSet()
           
 void init()
          Called after an interceptor is created, but before any requests are processed using intercept , giving the Interceptor a chance to initialize any needed resources.
 String intercept(ActionInvocation invocation)
          Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the ActionInvocation or to short-circuit the processing and just return a String return code.
 void setExcludeMethods(String excludeMethods)
           
 void setIncludeMethods(String includeMethods)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected transient org.apache.commons.logging.Log log

excludeMethods

protected Set excludeMethods

includeMethods

protected Set includeMethods
Constructor Detail

MethodFilterInterceptor

public MethodFilterInterceptor()
Method Detail

setExcludeMethods

public void setExcludeMethods(String excludeMethods)

getExcludeMethodsSet

public Set getExcludeMethodsSet()

setIncludeMethods

public void setIncludeMethods(String includeMethods)

getIncludeMethodsSet

public Set getIncludeMethodsSet()

intercept

public String intercept(ActionInvocation invocation)
                 throws Exception
Description copied from interface: Interceptor
Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the ActionInvocation or to short-circuit the processing and just return a String return code.

Specified by:
intercept in interface Interceptor
Returns:
the return code, either returned from ActionInvocation.invoke(), or from the interceptor itself.
Throws:
Exception - any system-level error, as defined in Action.execute().

applyInterceptor

protected boolean applyInterceptor(ActionInvocation invocation)

doIntercept

protected abstract String doIntercept(ActionInvocation invocation)
                               throws Exception
Subclasses must override to implement the interceptor logic.

Parameters:
invocation - the action invocation
Returns:
the result of invocation
Throws:
Exception

destroy

public void destroy()
Description copied from interface: Interceptor
Called to let an interceptor clean up any resources it has allocated.

Specified by:
destroy in interface Interceptor

init

public void init()
Description copied from interface: Interceptor
Called after an interceptor is created, but before any requests are processed using intercept , giving the Interceptor a chance to initialize any needed resources.

Specified by:
init in interface Interceptor

XWork Project Page