com.github.yoojia.halo.HaloStep Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of halo-core Show documentation
Show all versions of halo-core Show documentation
A FAST && THIN && HIGH SCALABLE Java web framework
package com.github.yoojia.halo;
/**
* @author YOOJIA.CHEN ([email protected])
*/
public abstract class HaloStep {
private final boolean mDefaultForwardEnabled;
/**
* 传递到一下个模块或处理器
*/
private boolean mForwardEnabled = false;
/**
* 设置默认处理传递状态的标志位
*/
protected HaloStep(boolean defaultForward) {
mDefaultForwardEnabled = defaultForward;
mForwardEnabled = defaultForward;
}
/**
* 允许请求继续传递给其它处理器或者模块。
*/
public void forward(){
mForwardEnabled = true;
}
/**
* 拦截请求,使请求终止传递。
*/
public void stop(){
mForwardEnabled = false;
}
/**
* PROTECTED: for hide this method
*/
protected boolean isForwardEnabled(){
return mForwardEnabled;
}
/**
* PROTECTED: for hide this method
*/
protected void reset(){
mForwardEnabled = mDefaultForwardEnabled;
}
}