hippo-core enable 添加开关.

pull/131/head
chen.ma 3 years ago
parent e11153aa12
commit 61d1f70a8f

@ -22,20 +22,25 @@ public class BootstrapCoreProperties implements BootstrapPropertiesInterface {
public static final String PREFIX = "spring.dynamic.thread-pool"; public static final String PREFIX = "spring.dynamic.thread-pool";
/**
* Enable dynamic thread pool.
*/
private Boolean enable = Boolean.TRUE;
/** /**
* Enabled banner. * Enabled banner.
*/ */
private Boolean banner; private Boolean banner = Boolean.TRUE;
/*** /***
* Enabled collect. * Enabled collect.
*/ */
private Boolean collect; private Boolean collect = Boolean.TRUE;
/** /**
* Check state interval. * Check state interval.
*/ */
private String checkStateInterval; private Integer checkStateInterval;
/** /**
* Config file type. * Config file type.

@ -20,6 +20,7 @@ import lombok.AllArgsConstructor;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -36,6 +37,7 @@ import org.springframework.core.annotation.Order;
@AllArgsConstructor @AllArgsConstructor
@EnableConfigurationProperties(BootstrapCoreProperties.class) @EnableConfigurationProperties(BootstrapCoreProperties.class)
@ImportAutoConfiguration({UtilAutoConfiguration.class}) @ImportAutoConfiguration({UtilAutoConfiguration.class})
@ConditionalOnProperty(prefix = BootstrapCoreProperties.PREFIX, value = "enable", matchIfMissing = true, havingValue = "true")
public class DynamicThreadPoolCoreAutoConfiguration { public class DynamicThreadPoolCoreAutoConfiguration {
private final BootstrapCoreProperties bootstrapCoreProperties; private final BootstrapCoreProperties bootstrapCoreProperties;

Loading…
Cancel
Save