|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAbstractInterceptor
ActionInterceptor
public abstract class ActionInterceptor
Base class for Page Flow action interceptors. These are configured in /WEB-INF/beehive-netui-config.xml like this:
<netui-config xmlns="http://beehive.apache.org/netui/2004/server/config"> ... <pageflow-action-interceptors> <global> <before-action> <action-interceptor> <interceptor-class>test.BeforeActionInterceptor1</interceptor-class> </action-interceptor> <action-interceptor> <interceptor-class>test.BeforeActionInterceptor2</interceptor-class> </action-interceptor> ... </before-action> <after-action> <action-interceptor> <interceptor-class>test.AfterActionInterceptor1</interceptor-class> </action-interceptor> <action-interceptor> <interceptor-class>test.AfterActionInterceptor2</interceptor-class> </action-interceptor> </after-action> </global> </pageflow-action-interceptors> ... </netui-config>Note that a registered ActionInterceptor is created and cached as a single instance per ServletContext. It should not hold any per-request or per-session state.
Constructor Summary | |
---|---|
ActionInterceptor()
|
Method Summary | |
---|---|
abstract void |
afterNestedIntercept(AfterNestedInterceptContext context)
Callback invoked after a nested page flow has been "injected" by preAction(org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain) , and before the original
action has run. |
abstract void |
postAction(ActionInterceptorContext context,
InterceptorChain chain)
Callback invoked after the action is processed. |
void |
postInvoke(InterceptorContext context,
InterceptorChain chain)
Callback invoked after the action is processed. |
abstract void |
preAction(ActionInterceptorContext context,
InterceptorChain chain)
Callback invoked before the action is processed. |
void |
preInvoke(InterceptorContext context,
InterceptorChain chain)
Callback invoked before the action is processed. |
protected void |
setOverrideForward(InterceptorForward forward,
ActionInterceptorContext context)
Override the Forward, either before or after the target action is run. |
Object |
wrapAction(ActionInterceptorContext context,
InterceptorChain chain)
Optional method that "wraps" the target action invocation. |
Methods inherited from class AbstractInterceptor |
---|
getConfig, init |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ActionInterceptor()
Method Detail |
---|
public abstract void preAction(ActionInterceptorContext context, InterceptorChain chain) throws InterceptorException
setOverrideForward(org.apache.beehive.netui.pageflow.interceptor.action.InterceptorForward, org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext)
may be called
to:
null
(no forwarding) and thus prevent the action from running, or,afterNestedIntercept(org.apache.beehive.netui.pageflow.interceptor.action.AfterNestedInterceptContext)
is called on this interceptor, which can again choose to override
the forward or allow the original action to run.
InterceptorChain.continueChain()
is called to invoke the rest of the
interceptor chain, anywhere within this method (e.g., at the end, or within a try/finally).
context
- the current ActionInterceptorContext.chain
- the interceptor chain. Calling continueChain
on this runs the rest of the interceptors.
InterceptorException
public void preInvoke(InterceptorContext context, InterceptorChain chain) throws InterceptorException
preAction(org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)
may be used instead.
InterceptorException
public abstract void postAction(ActionInterceptorContext context, InterceptorChain chain) throws InterceptorException
setOverrideForward(org.apache.beehive.netui.pageflow.interceptor.action.InterceptorForward, org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext)
may be called
to:
null
(no forwarding).InterceptorChain.continueChain()
is called to invoke the rest of the
interceptor chain, anywhere within this method (e.g., at the end, or within a try/finally).
context
- the current ActionInterceptorContext.chain
- the interceptor chain. Calling continueChain
on this runs the rest of the interceptors.
InterceptorException
public void postInvoke(InterceptorContext context, InterceptorChain chain) throws InterceptorException
postAction(org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)
may be used instead.
InterceptorException
public abstract void afterNestedIntercept(AfterNestedInterceptContext context) throws InterceptorException
preAction(org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)
, and before the original
action has run. During this method, setOverrideForward(org.apache.beehive.netui.pageflow.interceptor.action.InterceptorForward, org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext)
may be called to:
null
(no forwarding).InterceptorChain.continueChain()
is called to invoke the rest of the
interceptor chain, anywhere within this method (e.g., at the end, or within a try/finally).
context
- an extension of ActionInterceptorContext
which contains the return action from the
injected nested page flow.
InterceptorException
protected void setOverrideForward(InterceptorForward forward, ActionInterceptorContext context)
preAction(org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)
and
postAction(org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)
for information on how this is used.
forward
- an InterceptorForward that will override the target action's forward; or null
to
cancel navigation.context
- the current ActionInterceptorContext.public Object wrapAction(ActionInterceptorContext context, InterceptorChain chain) throws InterceptorException
continueChain
on the passed-in InterceptorChain, which allows the rest of the interceptors
and the action to run.
context
- the current ActionInterceptorContext.chain
- the interceptor chain. This chain is different from the ones passed to preAction(org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)
and
postAction(org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext, org.apache.beehive.netui.pageflow.interceptor.InterceptorChain)
in that the action invocation itself is included in it.
InterceptorException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |