com.opensymphony.xwork2.interceptor
Class MethodFilterInterceptor

java.lang.Object
  extended by com.opensymphony.xwork2.interceptor.AbstractInterceptor
      extended by com.opensymphony.xwork2.interceptor.MethodFilterInterceptor
All Implemented Interfaces:
Interceptor, java.io.Serializable
Direct Known Subclasses:
DefaultWorkflowInterceptor, ParametersInterceptor, PrepareInterceptor, ValidationInterceptor

public abstract class MethodFilterInterceptor
extends AbstractInterceptor

MethodFilterInterceptor is an abstract Interceptor used as a base class for interceptors that will filter execution based on method names according to specified included/excluded method lists.

Settable parameters are as follows:

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

Interceptors that extends this capability include:

Version:
$Date: 2009-12-27 19:18:29 +0100 (Sun, 27 Dec 2009) $ $Id: MethodFilterInterceptor.java 894090 2009-12-27 18:18:29Z martinc $
Author:
Alexandru Popescu, Rainer Hermanns
See Also:
org.apache.struts2.interceptor.TokenInterceptor, org.apache.struts2.interceptor.TokenSessionStoreInterceptor, DefaultWorkflowInterceptor, ValidationInterceptor, Serialized Form

Field Summary
protected  java.util.Set<java.lang.String> excludeMethods
           
protected  java.util.Set<java.lang.String> includeMethods
           
protected  Logger log
           
 
Constructor Summary
MethodFilterInterceptor()
           
 
Method Summary
protected  boolean applyInterceptor(ActionInvocation invocation)
           
protected abstract  java.lang.String doIntercept(ActionInvocation invocation)
          Subclasses must override to implement the interceptor logic.
 java.util.Set<java.lang.String> getExcludeMethodsSet()
           
 java.util.Set<java.lang.String> getIncludeMethodsSet()
           
 java.lang.String intercept(ActionInvocation invocation)
          Override to handle interception
 void setExcludeMethods(java.lang.String excludeMethods)
           
 void setIncludeMethods(java.lang.String includeMethods)
           
 
Methods inherited from class com.opensymphony.xwork2.interceptor.AbstractInterceptor
destroy, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected transient Logger log

excludeMethods

protected java.util.Set<java.lang.String> excludeMethods

includeMethods

protected java.util.Set<java.lang.String> includeMethods
Constructor Detail

MethodFilterInterceptor

public MethodFilterInterceptor()
Method Detail

setExcludeMethods

public void setExcludeMethods(java.lang.String excludeMethods)

getExcludeMethodsSet

public java.util.Set<java.lang.String> getExcludeMethodsSet()

setIncludeMethods

public void setIncludeMethods(java.lang.String includeMethods)

getIncludeMethodsSet

public java.util.Set<java.lang.String> getIncludeMethodsSet()

intercept

public java.lang.String intercept(ActionInvocation invocation)
                           throws java.lang.Exception
Description copied from class: AbstractInterceptor
Override to handle interception

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

applyInterceptor

protected boolean applyInterceptor(ActionInvocation invocation)

doIntercept

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

Parameters:
invocation - the action invocation
Returns:
the result of invocation
Throws:
java.lang.Exception


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.