class DtpMetricsPublisherThreadPool implements HystrixMetricsPublisherThreadPool {

    private static final String PROPERTY_PREFIX = "hystrix";
    private static final int DEFAULT_CORE_SIZE = 10;
    private static final int DEFAULT_MAXIMUM_SIZE = 10;
    private static final int DEFAULT_KEEP_ALIVE_TIME_MINUTES = 1;

    private final AtomicBoolean init = new AtomicBoolean(false);

    private final HystrixThreadPoolKey threadPoolKey;
    private final HystrixThreadPoolMetrics metrics;
    private final HystrixThreadPoolProperties threadPoolProperties;
    private final HystrixMetricsPublisherThreadPool metricsPublisherForThreadPool;

    public DtpMetricsPublisherThreadPool(
            final HystrixThreadPoolKey threadPoolKey,
            final HystrixThreadPoolMetrics metrics,
            final HystrixThreadPoolProperties threadPoolProperties,
            final HystrixMetricsPublisherThreadPool metricsPublisherForThreadPool) {
        this.threadPoolKey = threadPoolKey;
        this.metrics = metrics;
        this.threadPoolProperties = threadPoolProperties;
        this.metricsPublisherForThreadPool = metricsPublisherForThreadPool;
    }

    @Override
    public void initialize() {
        metricsPublisherForThreadPool.initialize();
        HystrixDtpAdapter hystrixTpHandler = ApplicationContextHolder.getBean(HystrixDtpAdapter.class);
        hystrixTpHandler.cacheMetricsPublisher(threadPoolKey.name(), this);
        hystrixTpHandler.register(threadPoolKey.name(), metrics);
    }

    public void refreshProperties(TpExecutorProps props) {<FILL_FUNCTION_BODY>}

    private static HystrixProperty<Integer> getProperty(HystrixThreadPoolKey key,
                                                        String instanceProperty,
                                                        Integer builderOverrideValue,
                                                        Integer defaultValue) {
        return forInteger()
                .add(getPropertyName(key.name(), instanceProperty), builderOverrideValue)
                .add(getDefaultPropertyName(instanceProperty), defaultValue)
                .build();
    }

    private static HystrixProperty<Boolean> getProperty(HystrixThreadPoolKey key,
                                                        String instanceProperty,
                                                        Boolean builderOverrideValue,
                                                        Boolean defaultValue) {
        return forBoolean()
                .add(getPropertyName(key.name(), instanceProperty), builderOverrideValue)
                .add(getDefaultPropertyName(instanceProperty), defaultValue)
                .build();
    }

    private static String getPropertyName(String key, String instanceProperty) {
        return PROPERTY_PREFIX + ".threadpool." + key + "." + instanceProperty;
    }

    private static String getDefaultPropertyName(String instanceProperty) {
        return PROPERTY_PREFIX + ".threadpool.default." + instanceProperty;
    }
}

        if (Objects.isNull(props)) {
            return;
        }

        try {
            if (!Objects.equals(threadPoolProperties.coreSize().get(), props.getCorePoolSize())) {
                val corePoolSize = getProperty(threadPoolKey, "coreSize",
                        props.getCorePoolSize(), DEFAULT_CORE_SIZE);
                ReflectionUtil.setFieldValue(HystrixThreadPoolProperties.class,
                        "corePoolSize", threadPoolProperties, corePoolSize);
            }

            if (!Objects.equals(threadPoolProperties.maximumSize().get(), props.getMaximumPoolSize())) {
                val maxPoolSize = getProperty(threadPoolKey, "maximumSize",
                        props.getMaximumPoolSize(), DEFAULT_MAXIMUM_SIZE);
                ReflectionUtil.setFieldValue(HystrixThreadPoolProperties.class,
                        "maximumPoolSize", threadPoolProperties, maxPoolSize);
            }

            val keepAliveTimeMinutes = (int) TimeUnit.SECONDS.toMinutes(props.getKeepAliveTime());
            if (!Objects.equals(threadPoolProperties.keepAliveTimeMinutes().get(), keepAliveTimeMinutes)) {
                val keepAliveTimeProperty = getProperty(threadPoolKey,
                        "keepAliveTimeMinutes", keepAliveTimeMinutes, DEFAULT_KEEP_ALIVE_TIME_MINUTES);
                ReflectionUtil.setFieldValue(HystrixThreadPoolProperties.class,
                        "keepAliveTime", threadPoolProperties, keepAliveTimeProperty);
            }

            if (init.compareAndSet(false, true)) {
                val allowSetMax = getProperty(threadPoolKey,
                        "allowMaximumSizeToDivergeFromCoreSize", true, true);
                ReflectionUtil.setFieldValue(HystrixThreadPoolProperties.class,
                        "allowMaximumSizeToDivergeFromCoreSize", threadPoolProperties, allowSetMax);
            }
        } catch (IllegalAccessException e) {
            log.error("DynamicTp hystrix adapter, reset hystrix threadPool properties failed.", e);
        }
    
<no_super_class>