// Path: elastic-config-core/src/main/java/com/github/config/listener/ElaticCofnigEventListener.java
// @Slf4j
// @RequiredArgsConstructor
// public class ElaticCofnigEventListener implements EventListener {
// 
//     private final ElasticConfig elasticConfig;
// 
//     @Subscribe
//     @AllowConcurrentEvents
//     public void listen(final ElasticConfigEvent event) {
//         log.info("recieve event:{}", event.toString());
//         elasticConfig.refresh();
//     }
// 
//     @Override
//     public String getName() {
//         return ElaticCofnigEventListener.class.getName();
//     }
// 
//     @Override
//     public void register() {
//         ElasticConfigEventBus.register(this);
// 
//     }
// }


import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import com.github.config.listener.ElaticCofnigEventListener;

package com.github.config.bus;



/**
 * ElasticConfig事件总线.
 *
 * @author ZhangWei
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ElasticConfigEventBus {

    private static final String NAME = "Config-EventBus";

    /**
     * 发布事件.
     *
     * @param event ElasticConfig事件
     */
    public static void pushEvent(final ElasticConfigEvent event) {

        ElasticConfigEventBusFactory.getInstance(NAME).pushEvent(event);
    }

    /**
     * 注册事件监听器.
     *
     * @param listener ElasticConfig事件监听器
     */

// Path: elastic-config-core/src/main/java/com/github/config/listener/ElaticCofnigEventListener.java
// @Slf4j
// @RequiredArgsConstructor
// public class ElaticCofnigEventListener implements EventListener {
// 
//     private final ElasticConfig elasticConfig;
// 
//     @Subscribe
//     @AllowConcurrentEvents
//     public void listen(final ElasticConfigEvent event) {
//         log.info("recieve event:{}", event.toString());
//         elasticConfig.refresh();
//     }
// 
//     @Override
//     public String getName() {
//         return ElaticCofnigEventListener.class.getName();
//     }
// 
//     @Override
//     public void register() {
//         ElasticConfigEventBus.register(this);
// 
//     }
// }


// Path: elastic-config-core/src/main/java/com/github/config/bus/ElasticConfigEventBus.java
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import com.github.config.listener.ElaticCofnigEventListener;

package com.github.config.bus;



/**
 * ElasticConfig事件总线.
 *
 * @author ZhangWei
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ElasticConfigEventBus {

    private static final String NAME = "Config-EventBus";

    /**
     * 发布事件.
     *
     * @param event ElasticConfig事件
     */
    public static void pushEvent(final ElasticConfigEvent event) {

        ElasticConfigEventBusFactory.getInstance(NAME).pushEvent(event);
    }

    /**
     * 注册事件监听器.
     *
     * @param listener ElasticConfig事件监听器
     */

    public static void register(final ElaticCofnigEventListener listener) {
