/*
 * Copyright 2016-2018 shardingsphere.io.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * </p>
 */

package io.shardingsphere.orchestration.internal.registry.config.listener;

import io.shardingsphere.orchestration.internal.registry.config.event.ConfigMapChangedEvent;
import io.shardingsphere.orchestration.internal.registry.config.node.ConfigurationNode;
import io.shardingsphere.orchestration.internal.registry.config.service.ConfigurationService;
import io.shardingsphere.orchestration.internal.registry.listener.PostShardingOrchestrationEventListener;
import io.shardingsphere.orchestration.reg.api.RegistryCenter;
import io.shardingsphere.orchestration.reg.listener.DataChangedEvent;

/**
 * Config map changed listener.
 *
 * @author caohao
 * @author panjuan
 */
public final class ConfigMapChangedListener extends PostShardingOrchestrationEventListener {
    
    private final ConfigurationService configService;
    
    public ConfigMapChangedListener(final String name, final RegistryCenter regCenter) {
        super(regCenter, new ConfigurationNode(name).getConfigMapPath());
        configService = new ConfigurationService(name, regCenter);
    }
    
    @Override
    protected ConfigMapChangedEvent createShardingOrchestrationEvent(final DataChangedEvent event) {
        return new ConfigMapChangedEvent(configService.loadConfigMap());
    }
}

@@ -874,102 +874,8 @@
 de;%0A
-import io.shardingsphere.orchestration.internal.registry.config.service.ConfigurationService;%0A
 impo
@@ -972,24 +972,24 @@
 ntListener;%0A
+
 import io.sh
@@ -1108,16 +1108,88 @@
 edEvent;
+%0Aimport io.shardingsphere.orchestration.yaml.ConfigurationYamlConverter;
 %0A%0A/**%0A *
@@ -1364,67 +1364,8 @@
    %0A
-    private final ConfigurationService configService;%0A    %0A
     
@@ -1527,75 +1527,8 @@
 ));%0A
-        configService = new ConfigurationService(name, regCenter);%0A
     
@@ -1694,36 +1694,65 @@
 ent(
-c
+C
 onfig
-Service.loadConfigMap(
+urationYamlConverter.loadConfigMap(event.getValue()
 ));%0A

modify ConfigMapChangedListener