package com.qmth.boot.core.schedule.config;

import com.qmth.boot.core.constant.CoreConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Min;

@Component
@ConfigurationProperties(prefix = CoreConstant.CONFIG_PREFIX + ".executor")
@Validated
public class ExecutorProperties {

    @Min(1)
    private int poolSize = Runtime.getRuntime().availableProcessors() * 2;

    public int getPoolSize() {
        return poolSize;
    }

    public void setPoolSize(int poolSize) {
        this.poolSize = poolSize;
    }
}
