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

cn.yueshutong.springbootstartercurrentlimiting.properties.CurrentProperties Maven / Gradle / Ivy

There is a newer version: 0.1.1.RELEASE
Show newest version
package cn.yueshutong.springbootstartercurrentlimiting.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Create by [email protected] 2019/4/21 0021 11:19
 */
@Component
@ConfigurationProperties(prefix = "current.limiting")
public class CurrentProperties {
    /**
     * Do you want to turn on the current limiting ?
     */
    private boolean enabled = false;

    /**
     * Do you want to turn on the annotation current limiter?
     */
    private boolean partEnabled = true;

    /**
     * Do you want to turn on the cluster current limiter?
     */
    private boolean cloudEnabled = false;

    /**
     * How many seconds will it take to reclaim the expired limiter object?
     */
    private long recycling = 10;

    /**
     * The number of core threads in the thread pool performing the scheduled task.
     */
    private int corePoolSize = 10;

    public boolean isEnabled() {
        return enabled;
    }


    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public boolean isPartEnabled() {
        return partEnabled;
    }

    public void setPartEnabled(boolean partEnabled) {
        this.partEnabled = partEnabled;
    }

    public int getCorePoolSize() {
        return corePoolSize;
    }

    public void setCorePoolSize(int corePoolSize) {
        this.corePoolSize = corePoolSize;
    }

    public boolean isCloudEnabled() {
        return cloudEnabled;
    }

    public long getRecycling() {
        return recycling;
    }

    public void setRecycling(long recycling) {
        this.recycling = recycling;
    }

    public void setCloudEnabled(boolean cloudEnabled) {
        this.cloudEnabled = cloudEnabled;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy