com.opensymphony.xwork.interceptor
Interface Interceptor

All Known Implementing Classes:
AbstractLifecycleInterceptor, AroundInterceptor, DefaultWorkflowInterceptor, TimerInterceptor

public interface Interceptor

An interceptor is a stateless class that follows the interceptor pattern, as found in Filter and in AOP languages.

Interceptors must be stateless and not assume that a new instance will be created for each request or Action. Interceptors may choose to either short-circuit the ActionInvocation execution and return a return code (such as Action.SUCCESS), or it may choose to do some processing before and/or after delegating the rest of the procesing using ActionInvocation.invoke().

Author:
Jason Carreira

Method Summary
 void destroy()
          Called to let an interceptor clean up any resources it has allocated.
 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.
 

Method Detail

destroy

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


init

public 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.


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 ActionInvocation or to short-circuit the processing and just return a String return code.

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().

XWork Project Page