|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.action.interceptor.ConditionalInterceptor
public abstract class ConditionalInterceptor
An interceptor which will conditionally execute its logic based on rules around what method of the action is being called.
For example, if you want to intercept and execute something on all methods except for 'default', set the disallow property to "default". If you want to disable execution for the 'foo' method as well, set the disallow property to "default,foo". Similarly, to enable execution for the 'bar' method and no others, set the allow property to 'bar'. If the allow or disallow properties were never set then the interceptor logic is executed for all methods.
Additionally, you can specify when the logic should be executed - either before or after the interceptor chain is called. By default the logic will be executed *before*.
Field Summary | |
---|---|
static java.lang.String |
AFTER
Constant to indicate the interceptor logic should be invoked after passing control down the interceptor chain. |
static java.lang.String |
BEFORE
Constant to indicate the interceptor logic should be invoked before passing control down the interceptor chain. |
Constructor Summary | |
---|---|
ConditionalInterceptor()
|
Method Summary | |
---|---|
void |
destroy()
Does nothing in this implementation. |
java.lang.String |
getAllow()
Returns the allow parameter. |
java.lang.String |
getDisallow()
Returns the disallow parameter. |
java.lang.String |
getType()
Sets the type of interceptor this is - whether or not to execute its logic before or after passing control down the interceptor chain. |
void |
init()
Sets the default type to be BEFORE . |
java.lang.String |
intercept(com.opensymphony.xwork.ActionInvocation in)
Calls ActionInvocation.invoke() based on the type - it will be called either before or after
the main logic of this interceptor is called. |
protected abstract java.lang.String |
performAction(com.opensymphony.xwork.ActionInvocation in)
The core logic of the interceptor. |
void |
setAllow(java.lang.String allow)
Sets the allow parameter. |
void |
setDisallow(java.lang.String disallow)
Sets the disallow parameter. |
void |
setType(java.lang.String type)
Sets the type of interceptor this is - a before or after one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BEFORE
public static final java.lang.String AFTER
Constructor Detail |
---|
public ConditionalInterceptor()
Method Detail |
---|
public java.lang.String getAllow()
public void setAllow(java.lang.String allow)
public java.lang.String getDisallow()
public void setDisallow(java.lang.String disallow)
public java.lang.String getType()
BEFORE
or AFTER
.
public void setType(java.lang.String type)
type
- either BEFORE
or AFTER
public void init()
BEFORE
.
init
in interface com.opensymphony.xwork.interceptor.Interceptor
public void destroy()
destroy
in interface com.opensymphony.xwork.interceptor.Interceptor
public java.lang.String intercept(com.opensymphony.xwork.ActionInvocation in) throws java.lang.Exception
ActionInvocation.invoke()
based on the type - it will be called either before or after
the main logic of this interceptor is called. Additionally, the logic may be skipped depending on the allow
or disallow rules.
intercept
in interface com.opensymphony.xwork.interceptor.Interceptor
in
- the action's invocation which is basically the execution state.
java.lang.Exception
- if an error occurs when executing the interceptor.protected abstract java.lang.String performAction(com.opensymphony.xwork.ActionInvocation in) throws java.lang.Exception
in
- the action invocation.
java.lang.Exception
- if an error occurs when executing the interceptor.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |