/*
 * 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.proxy.listener;

import io.shardingsphere.transaction.listener.local.LocalTransactionListener;
import io.shardingsphere.transaction.listener.xa.XATransactionListener;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * Listener register for Proxy.
 *
 * @author zhangliang
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ProxyListenerRegister {
    
    /**
     * Register all listeners.
     */
    public static void register() {
        new LocalTransactionListener().register();
        new XATransactionListener().register();
    }
}

@@ -656,16 +656,130 @@
 tener;%0A%0A
+import io.shardingsphere.core.event.ShardingEventBusInstance;%0Aimport io.shardingsphere.proxy.config.RuleRegistry;%0A
 import i
@@ -1042,16 +1042,35 @@
 ngliang%0A
+ * @author panjuan%0A
  */%0A@NoA
@@ -1201,16 +1201,65 @@
 teners.%0A
+     *%0A     * @param ruleRegistry rule registry.%0A
      */%0A
@@ -1290,16 +1290,47 @@
 egister(
+final RuleRegistry ruleRegistry
 ) %7B%0A    
@@ -1420,20 +1420,91 @@
 register();%0A
+        ShardingEventBusInstance.getInstance().register(ruleRegistry);%0A
     %7D%0A%7D%0A

use ShardingEventBusInstance.getInstance().register(ruleRegistry);