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, Serializable
Direct Known Subclasses:
DefaultWorkflowInterceptor, ExecuteAndWaitInterceptor, ParametersInterceptor, PrepareInterceptor, TokenInterceptor, ValidationInterceptor

public abstract class MethodFilterInterceptor
extends AbstractInterceptor

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-09-24 06:45:01 +0200 (So, 24 Sep 2006) $ $Id: MethodFilterInterceptor.java 1138 2006-09-24 04:45:01Z mrdon $
Author:
Alexandru Popescu, Rainer Hermanns
See Also:
TokenInterceptor, TokenSessionStoreInterceptor, DefaultWorkflowInterceptor, ValidationInterceptor, Serialized Form

Field Summary
protected  Set excludeMethods
           
protected  Set includeMethods
           
protected  Log log
           
 
Constructor Summary
MethodFilterInterceptor()
           
 
Method Summary
protected  boolean applyInterceptor(ActionInvocation invocation)
           
protected abstract  String doIntercept(ActionInvocation invocation)
          Subclasses must override to implement the interceptor logic.
 Set getExcludeMethodsSet()
           
 Set getIncludeMethodsSet()
           
 String intercept(ActionInvocation invocation)
          Override to handle interception
 void setExcludeMethods(String excludeMethods)
           
 void setIncludeMethods(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 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 class: AbstractInterceptor
Override to handle interception

Specified by:
intercept in interface Interceptor
Specified by:
intercept in class AbstractInterceptor
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


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