com.opensymphony.xwork.interceptor
Class AbstractLifecycleInterceptor

java.lang.Object
  extended bycom.opensymphony.xwork.interceptor.AbstractLifecycleInterceptor
All Implemented Interfaces:
Interceptor, PreResultListener, Serializable

public abstract class AbstractLifecycleInterceptor
extends Object
implements Interceptor, PreResultListener

AbstractLifecycleInterceptor is a convenience interceptor that is like an

Version:
$Date: 2006-03-19 17:17:47 +0100 (Sun, 19 Mar 2006) $ $Id: AbstractLifecycleInterceptor.java 913 2006-03-19 17:17:47 +0100 (Sun, 19 Mar 2006) tmjee $
Author:
Jason Carreira
See Also:
Serialized Form

Constructor Summary
AbstractLifecycleInterceptor()
           
 
Method Summary
protected  void after(ActionInvocation invocation, String result)
          Called after the Action and Result have been executed.
protected  void before(ActionInvocation invocation)
          Called before the rest of the ActionInvocation is forwarded to.
 void beforeResult(ActionInvocation invocation, String resultCode)
          This callback method will be called after the Action execution and before the Result execution.
 void destroy()
          Called to let an interceptor clean up any resources it has allocated.
protected  void handleException(Exception e)
          Called if an Exception is caught while executing the before(), the rest of the ActionInvocation, including the Action and Result execution, or the after() call.
 void init()
          Called after an Interceptor is created, but before any requests are processed using the intercept() methodName.
 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 DefaultActionInvocation or to short-circuit the processing and just return a String return code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLifecycleInterceptor

public AbstractLifecycleInterceptor()
Method Detail

beforeResult

public void beforeResult(ActionInvocation invocation,
                         String resultCode)
This callback method will be called after the Action execution and before the Result execution.

Specified by:
beforeResult in interface PreResultListener
Parameters:
invocation -
resultCode -

destroy

public void destroy()
Called to let an interceptor clean up any resources it has allocated.

Specified by:
destroy in interface Interceptor

init

public void init()
Called after an Interceptor is created, but before any requests are processed using the intercept() methodName. This gives the Interceptor a chance to initialize any needed resources.

Specified by:
init in interface Interceptor

intercept

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

Specified by:
intercept in interface Interceptor
Parameters:
invocation -
Returns:
result
Throws:
Exception

after

protected void after(ActionInvocation invocation,
                     String result)
              throws Exception
Called after the Action and Result have been executed.

Parameters:
invocation -
result -
Throws:
Exception

before

protected void before(ActionInvocation invocation)
               throws Exception
Called before the rest of the ActionInvocation is forwarded to.

Parameters:
invocation -
Throws:
Exception

handleException

protected void handleException(Exception e)
                        throws Exception
Called if an Exception is caught while executing the before(), the rest of the ActionInvocation, including the Action and Result execution, or the after() call. The default implementation just rethrows the Exception. Subclasses can choose to either throw an Exception or do some processing.

Parameters:
e - the Exception caught
Throws:
Exception

XWork Project Page