All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.yoojia.halo.HaloStep Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy