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

net.neoremind.haguard.AbstractHaGuard Maven / Gradle / Ivy

The newest version!
package net.neoremind.haguard;

/**
 * HaGuard抽象实现
 *
 * @author hexiufeng, zhangxu
 */
public abstract class AbstractHaGuard implements HaGuard {

    /**
     * 默认超时时间,默认10s,阻塞fountain主进程的时间
     */
    private long defaultTimeoutMs = 10000;

    @Override
    public boolean takeTokenWithDefaultTimeout() {
        return takeToken(defaultTimeoutMs);
    }

    public long getDefaultTimeoutMs() {
        return defaultTimeoutMs;
    }

    public void setDefaultTimeoutMs(long defaultTimeoutMs) {
        this.defaultTimeoutMs = defaultTimeoutMs;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy