class ZookeeperRefresher extends AbstractRefresher implements EnvironmentAware, InitializingBean {

    public ZookeeperRefresher(DtpProperties dtpProperties) {
        super(dtpProperties);
    }

    @Override
    public void afterPropertiesSet() {<FILL_FUNCTION_BODY>}

    /**
     * load config and refresh
     */
    private void loadAndRefresh() {
        refresh(CuratorUtil.genPropertiesMap(dtpProperties));
    }

    /**
     * ZK_PROPERTY_SOURCE just for DtpBeanDefinitionRegistrar
     *
     * @param environment environment
     */
    private void cleanZkPropertySource(Environment environment) {
        ConfigurableEnvironment env = ((ConfigurableEnvironment) environment);
        env.getPropertySources().remove(ZkConfigEnvironmentProcessor.ZK_PROPERTY_SOURCE_NAME);
    }
}


        final ConnectionStateListener connectionStateListener = (client, newState) -> {
            if (newState == ConnectionState.RECONNECTED) {
                loadAndRefresh();
            }
        };

        final CuratorListener curatorListener = (client, curatorEvent) -> {
            final WatchedEvent watchedEvent = curatorEvent.getWatchedEvent();
            if (null != watchedEvent) {
                switch (watchedEvent.getType()) {
                    case NodeChildrenChanged:
                    case NodeDataChanged:
                        loadAndRefresh();
                        break;
                    default:
                        break;
                }
            }
        };

        CuratorFramework curatorFramework = CuratorUtil.getCuratorFramework(dtpProperties);
        String nodePath = CuratorUtil.nodePath(dtpProperties);

        curatorFramework.getConnectionStateListenable().addListener(connectionStateListener);
        curatorFramework.getCuratorListenable().addListener(curatorListener);
        cleanZkPropertySource(environment);
        log.info("DynamicTp refresher, add listener success, nodePath: {}", nodePath);
    
<methods>public void refresh(java.lang.String, org.dromara.dynamictp.common.em.ConfigFileTypeEnum) ,public void setEnvironment(Environment) <variables>protected final non-sealed org.dromara.dynamictp.common.properties.DtpProperties dtpProperties,protected Environment environment